public async Task Insert(AlimentCategory entity) { var queryParameters = new DynamicParameters(); queryParameters.Add("@Id", entity.Id); queryParameters.Add("@Label", entity.Label); await Execute("InsertAlimentCategory", queryParameters); }
private async Task ProcessCategory(int row, int col, IList <AlimentCategory> categories) { string categoryLabel = GetCellValue(row, col); if (!string.IsNullOrEmpty(categoryLabel)) { AlimentCategory category = Categories.FirstOrDefault(x => x.Label == categoryLabel); if (category == null) { category = new AlimentCategory { Id = Guid.NewGuid(), Label = categoryLabel }; Categories.Add(category); await _alimentCategoryRepository.Insert(category); } categories.Add(category); } }