none
What is this called? - ANSWER: LINQ RRS feed

  • Question

  • I know what a SQL statement is, but when referring to Visual Basic, is the following called that as well or does it have a different name.

    I would like to find reference at Microsoft Docs about it, but my searches have not been successful.


    https://awwshop.wikidot.com


    • Edited by GeoFrias Friday, November 22, 2019 5:41 PM Solved
    Friday, November 22, 2019 3:59 PM

Answers

All replies

  • Hi

    Try THIS LINK and see if it is what you want.


    Regards Les, Livingston, Scotland

    • Marked as answer by GeoFrias Friday, November 22, 2019 5:25 PM
    Friday, November 22, 2019 4:12 PM
  • You do not show the declaration of sourceList. The declaration will have the class. You need to find the documentation of that class and then you will find the documentation of the AddRange method. If you right-click on sourceList then select Go To Declaration then it will go directly there.

    In the future please do not post images of your source code; copy the code to the clipboard and paste it in using the Insert Code Block icon; the one with the "<>".



    Sam Hobbs
    SimpleSamples.Info

    Friday, November 22, 2019 4:30 PM
  • Here is documentation

    From clause, Where clause, Select clause.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, November 22, 2019 4:45 PM
    Moderator
  • I am still learning to use the forum, thank you for your advice.

    sourceList.AddRange(From t2 In t1.str_.Split(","c) Where Not String.IsNullOrEmpty(t2) Select t2.Trim)

    It came from MSDN Forums


    https://awwshop.wikidot.com

    Friday, November 22, 2019 5:16 PM
  • I am still learning to use the forum, thank you for your advice.

    sourceList.AddRange(From t2 In t1.str_.Split(","c) Where Not String.IsNullOrEmpty(t2) Select t2.Trim)

    It came from MSDN Forums


    https://awwshop.wikidot.com

    public Function  GetProjectsByUserId(userid As String) As ProjectViewModels Implements  IProjectModel.GetProjectsByUserId
    
                dim vm = new ProjectViewModels With {.Projects = new List(of ProjectViewModels.Project)}
    
                dim dtos = _webApi.GetProjsByUserIdApi(userid).ToList()
    
                vm.Projects.AddRange(dtos.Select(Function(dto) New ProjectViewModels.Project() With{.ProjectId = dto.ProjectId,
                                                                                                    .ClientName = dto.ClientName,
                                                                                                    .ProjectName = dto.ProjectName,
                                                                                                    .Technology = dto.Technology,
                                                                                                    .ProjectType = dto.ProjectType,
                                                                                                    .StartDate = dto.StartDate,
                                                                                                    .EndDate = dto.EndDate,
                                                                                                    .Cost = dto.Cost}).ToList())
                Return vm
    
            End Function
    Imports System.ComponentModel.DataAnnotations
    
    Namespace Models
    
        Public Class ProjectViewModels
    
            public Class Project
    
                public Property  ProjectId As int32
    
                <Required(ErrorMessage: = "Client Name is required")>
                <StringLength(50)>
                public property ClientName As String 
    
                <Required(ErrorMessage: = "Project Name is required")>
                <StringLength(50)>
                public property ProjectName  as String
    
                <Required(ErrorMessage: = "Technology is required")>
                <StringLength(50)>
                public property Technology As String
    
                <Required(ErrorMessage: = "Project Type is required")>
                public property ProjectType As String
    
                <Required(ErrorMessage: = "Start Date is required")>
                <DisplayFormat(ApplyFormatInEditMode: = true, DataFormatString: = "{0:MM-dd-yyyy}")>
                public  Property  StartDate As DateTime? 
    
                <Required(ErrorMessage: = "End Date is required")>
                <DisplayFormat(ApplyFormatInEditMode: = true, DataFormatString: = "{0:MM-dd-yyyy}")>
                public  Property  EndDate As DateTime?
    
                <Required(ErrorMessage: = "Cost is required")>
                public Property  Cost As decimal?
    
                public Property ProjectTypes As List(of SelectListItem)
            end Class 
        
            public Property Projects As List(of Project)
    
        End Class
    End NameSpace

    Public Class DtoProject
    
        Public Property ProjectId As Int32
        Public Property ClientName As String
        Public Property ProjectName As String
        Public Property Technology As String
        Public Property ProjectType As String
        Public Property UserId As String
        Public Property StartDate  As DateTime
        Public Property EndDate As DateTime? 
        Public Property Cost As Decimal
       
    End Class



    Saturday, November 23, 2019 6:01 AM
  • Hi

    Try THIS LINK and see if it is what you want.


    Regards Les, Livingston, Scotland

    I see that GeoFrias never told us what sourceList is. Obviously GeoFrias appreciates the easy (for GeoFrias) solution. I try to teach them how to get the answers faster in the future.



    Sam Hobbs
    SimpleSamples.Info

    Saturday, November 23, 2019 6:26 AM