Data Models

Tom Meier 140 Reputation points
2024-05-01T21:46:42.2566667+00:00

I have two Models, CustomerModel and CustomerInfo neither one relates to the other except that the Model(s) have fields in the same table and I wanted to separate the fields in the Models because they are used in different views of my .Net Maui Application. The Query below is not pulling in the values from CustomerInfo Model. We are using Dapper ORM and I was told to use the command called QueryMultiple so I thought I would see if anyone can give me some tips on getting started. Thanks !!!

public List<CustomerModel> GetCustomer(int Id)

{

string sql= "SELECT c.Id, c.Name, c.Address, c.AuthorizedToSign " +

"FROM Company as c " +

"WHERE c.ID=@Id ";

}

Public Class CustomerModel

{

public string Id{get;set:}

public string Name {get;set:}

public string Address{get;set:}

public Customelnfo Customer {get;set;}

}

Public Class CustomerInfo

{

public string AuthorizedToSign {get;set;}

}

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,957 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,343 questions
{count} votes