/// <summary> /// Edit dealer configuration by id. /// </summary> /// <param name="objDealerConfiguration"></param> /// <param name="dealerId"></param> public async Task EditDealerConfiguration(DealerConfiguration objDealerConfiguration, int dealerId) { using (ConfigurationManagerContext context = new ConfigurationManagerContext(_connectionString)) { var list = context.Set <DealerConfiguration>().ToList(); objDealerConfiguration.DealerId = dealerId; context.Entry(context.Set <DealerConfiguration>().Find(dealerId)).CurrentValues.SetValues(objDealerConfiguration); await context.SaveChangesAsync(); } }
/// <summary> /// Add dealer configuration /// </summary> /// <param name="objDealerConfiguration"></param> /// <returns></returns> public async Task <int> AddDealerConfiguration(DealerConfiguration objDealerConfiguration) { using (ConfigurationManagerContext context = new ConfigurationManagerContext(_connectionString)) { context.DealConfigurations.Add(objDealerConfiguration); await context.SaveChangesAsync(); return(objDealerConfiguration.DealerId); } }
/// <summary> /// Map dealer invitation response with dealer configuration. /// </summary> /// <param name="dealerConfig"></param> /// <returns></returns> internal DealerInvitationContentResponse MapDealerInvitationResponse(DealerConfiguration dealerConfig) { return(_mapper.Map <DealerConfiguration, DealerInvitationContentResponse>(dealerConfig)); }