Hi,
Following are the two tables :-
table1 -
[Table("Products")]
public class Entity_Product : FullAuditedEntity
{
public const int MaxLength_Name = 50;
[MaxLength(MaxLength_Name)]
public virtual string Name { get; set; }
[ForeignKey("Admin_Site_FK")]
public Entity_Admin_Site Entity_Admin_Site { get; set; }
public virtual int Admin_Site_FK { get; set; }
[ForeignKey("Product_Unit_FK")]
public Entity_Product_Unit Entity_Product_Unit { get; set; }
public virtual int Product_Unit_FK { get; set; }
public virtual int Withdrawl { get; set; }
public virtual bool Fixed_Dosage { get; set; }
public virtual int Base_Weight { get; set; }
public virtual float Unit_Base_Weight { get; set; }
public virtual int Default_Duration { get; set; }
public virtual int PTI { get; set; }
public virtual float Cost { get; set; }
public virtual bool Single_Use { get; set; }
public virtual bool Treatment { get; set; }
public virtual int? TenantId { get; set; }
public virtual bool IsActive { get; set; }
// Navigation Properties
public List<Entity_Product_Pricing> Entity_Product_Pricing { get; set; }
}
table2-
[Table("Product_Pricing")]
public class Entity_Product_Pricing : FullAuditedEntity
{
[ForeignKey("Product_Id_FK")]
public Entity_Product Entity_Product { get; set; }
public virtual int? Product_Id_FK { get; set; }
[ForeignKey("Configuration_Detail_Id_FK")]
public Entity_Configuration_Detail Entity_Configuration_Detail { get; set; }
public virtual int? Configuration_Detail_Id_FK { get; set; }
public float Price { get; set; }
}
Following are the Dtos :-
Dto of table1 :-
[AutoMapFrom(typeof(Entity_Product))]
[AutoMapTo(typeof(Entity_Product))]
public class CreateEditProductsInput
{
public int? Id { get; set; }
[Required]
[Display(Name = "Product Name")]
[MaxLength(Entity_Product.MaxLength_Name)]
public string Name { get; set; }
[Required(ErrorMessage = "The Admin Site field is required.")]
[Display(Name = "Admin Site")]
public int Admin_Site_FK { get; set; }
[Required(ErrorMessage = "The Product Unit field is required.")]
[Display(Name = "Product Unit")]
public int Product_Unit_FK { get; set; }
[Required(ErrorMessage = "The Withdrawal field is required.")]
[Display(Name = "Product Unit")]
public int? Withdrawl { get; set; }
public bool Fixed_Dosage { get; set; }
public int? Base_Weight { get; set; }
[Required(ErrorMessage = "The Units/Base Weight field is required.")]
[Display(Name = "Product Unit")]
public float? Unit_Base_Weight { get; set; }
public int? Default_Duration { get; set; }
public int? PTI { get; set; }
public float Cost { get; set; }
public bool Single_Use { get; set; }
public bool Treatment { get; set; }
public int? TenantId { get; set; }
// Navigation Properties
public List<CreateEditProductPricingInput> Entity_Product_Pricing { get; set; }
}
Dto of table 2 :-
[AutoMapTo(typeof(Entity_Product_Pricing))]
[AutoMapFrom(typeof(Entity_Product_Pricing))]
public class CreateEditProductPricingOutput: CreateEditProductPricingInput
{
public long? CreatorUserId { get; set; }
public DateTime CreationTime { get; set; }
public long? LastModifierUserId { get; set; }
public DateTime? LastModificationTime { get; set; }
}
Thanks
Hi,
I have two tables table1 and table2. table2 has foreign key relationship with table1. Table2 contains the table1_fk_Id column. Now i am using following code to insert data into both tables:-
Table1 record = _objectMapper.Map<Table1>(input);
await _Table1Repository.InsertAsync(record);
(where input is table1 dto class which contains Navigation Property of table2.)
This code is working fine. It is inserting record in both tables. I want to know how can i update both the tables, because when i tried to update it is only updating table1 record.
Thanks.
No, I never used these scripts (npm run build) for production in other projects. Can you please provide me steps how to build scripts for production ?
I tried setting this. but it doesn't work.
Hi,
How can i set the minimum length of password to 4. Currently i set the MinPlainPasswordLength to 4 in User class which works on client side but when the request is going to server it is giving error that password should be 6 characters minimum.
The error is coming from ChangePasswordAsync method. Please suggest to reduce minimum password length.
Thanks
Hi,
My Product version is 7.2.0.0 and i am using ASP.NET MVC & jquery (.net framework). I want a page inside MPA folder which i want to access without login and want to use layout page also. How can i achieve this?
Thanks
I want to access a page without login. I have added [AllowAnonymous] but applccation redirect to login page every time. How we can stop this and access page without login?