Thang CHO BOC
Thang CHO BOC
CC#
Created by Thang CHO BOC on 10/22/2024 in #help
Entity navigation modelling so I can understand it better
No description
2 replies
CC#
Created by Thang CHO BOC on 10/19/2024 in #help
Web API DAL entities (OnModelCreating)
or? public object Offer { get; internal set; }?
11 replies
CC#
Created by Thang CHO BOC on 10/19/2024 in #help
Web API DAL entities (OnModelCreating)
public class ApplicationUser : IdentityUser
{
public string Role { get; set; }

}
public class ApplicationUser : IdentityUser
{
public string Role { get; set; }

}
so that means I have to add a "return relation" ICollection<Orders> Order {get;set;}?
11 replies
CC#
Created by Thang CHO BOC on 10/19/2024 in #help
Web API DAL entities (OnModelCreating)
No description
11 replies
CC#
Created by Thang CHO BOC on 10/19/2024 in #help
Web API DAL entities (OnModelCreating)
No description
11 replies
CC#
Created by Thang CHO BOC on 10/19/2024 in #help
Web API DAL entities (OnModelCreating)
yes
11 replies
CC#
Created by Thang CHO BOC on 10/19/2024 in #help
Web API DAL entities (OnModelCreating)
for the Orders i dont have to backtrack the relation because i use the ID as the attribute but when I have Offer i have to backtrack to get the OnModelCreating working is that supposed to be correct?
11 replies
CC#
Created by Thang CHO BOC on 10/19/2024 in #help
Web API DAL entities (OnModelCreating)
public class Offers
{
public int Id { get; set; }
public required string Name { get; set; }
public required int Price { get; set; }
public required string Currency { get; set; }
public required string Amount { get; set; }
public required string UnitsAvaiable { get; set; }
public required string Origin { get; set; }
public required string OfferType { get; set; } = "Online";
public required ICollection<CropCategories> CropCategory { get; set; }

// Return relations
public ApplicationUser User { get; set; }
public ICollection<Crops> Crop { get; set; }
public ICollection<Orders> Order { get; set; }
}
public class Offers
{
public int Id { get; set; }
public required string Name { get; set; }
public required int Price { get; set; }
public required string Currency { get; set; }
public required string Amount { get; set; }
public required string UnitsAvaiable { get; set; }
public required string Origin { get; set; }
public required string OfferType { get; set; } = "Online";
public required ICollection<CropCategories> CropCategory { get; set; }

// Return relations
public ApplicationUser User { get; set; }
public ICollection<Crops> Crop { get; set; }
public ICollection<Orders> Order { get; set; }
}
11 replies
CC#
Created by Thang CHO BOC on 10/19/2024 in #help
Web API DAL entities (OnModelCreating)
example
public class Orders
{
public int Id { get; set; }
public required Offers Offer { get; set; }
public required ApplicationUser User { get; set; }
public string Amount { get; set; }
public required string Price { get; set; }
public string PaymentType { get; set; }
public bool Status { get; set; }
}
public class Orders
{
public int Id { get; set; }
public required Offers Offer { get; set; }
public required ApplicationUser User { get; set; }
public string Amount { get; set; }
public required string Price { get; set; }
public string PaymentType { get; set; }
public bool Status { get; set; }
}
11 replies
CC#
Created by Thang CHO BOC on 10/19/2024 in #help
Web API DAL entities (OnModelCreating)
If I have to have a "back relation" is modifier as required? (or record or readonly?)
11 replies