/// <summary>
 /// Used for viewmodel to dbmodel
 /// </summary>
 private IPWovenTypeModel MappingDbModel(IPWovenTypeViewModel viewModel)
 {
     return(new IPWovenTypeModel(viewModel.Code, viewModel.WovenType));
 }
        public Task <int> Create(IPWovenTypeViewModel model)
        {
            var mappingModel = MappingDbModel(model);

            return(_repository.InsertAsync(mappingModel));
        }
 public Task <int> Update(int id, IPWovenTypeViewModel model)
 {
     return(_repository.UpdateAsync(id,
                                    MappingDbModel(model)));
 }