public void Should_Success_GarmentCourierProfile() { var mapper = new MapperConfiguration(configuration => configuration.AddProfile <GarmentCourierProfile>()).CreateMapper(); var model = new GarmentCourierModel(); var vm = mapper.Map <GarmentCourierViewModel>(model); Assert.NotNull(vm); }
public async Task <int> CreateAsync(GarmentCourierModel model) { model.FlagForCreate(_IdentityService.Username, _UserAgent); model._LastModifiedAgent = model._CreatedAgent; model._LastModifiedBy = model._CreatedBy; model._LastModifiedUtc = model._CreatedUtc; _DbSet.Add(model); return(await _DbContext.SaveChangesAsync()); }
public GarmentCourierModel GetNewData() { Guid guid = Guid.NewGuid(); GarmentCourierModel model = new GarmentCourierModel { Code = $"Code{guid}", Name = $"Name{guid}", Address = $"Address{guid}", Attention = $"Attention{guid}", PhoneNumber = $"PhoneNumber{guid}", FaxNumber = $"FaxNumber{guid}", Email = $"Email{guid}", NPWP = $"NPWP{guid}", }; return(model); }
public async Task <int> UpdateAsync(int id, GarmentCourierModel model) { model.FlagForUpdate(_IdentityService.Username, _UserAgent); _DbSet.Update(model); return(await _DbContext.SaveChangesAsync()); }