public async Task CreateAsync(DeviceCategory deviceCategory) { if (await ExistsAsync(deviceCategory.DeviceCategoryName)) { throw new UserFriendlyException(L("Device category already exists")); } await _deviceCategoryRepository.InsertAsync(deviceCategory); }
public async Task CreateAsync(string deviceCategoryName) { if (await ExistsAsync(deviceCategoryName)) { throw new UserFriendlyException(L("Device category already exists")); } var deviceCategory = new DeviceCategory {DeviceCategoryName = deviceCategoryName}; await _deviceCategoryRepository.InsertAsync(deviceCategory); }