-
-
Save Pownraj-2818/e1a5924d49497b1200642c3b478b4918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task Create(SpaceCategoryRequestModel model) | |
{ | |
if (_context.SpaceCategories.Any(x => x.SpaceCategoryName == model.SpaceCategoryName && !x.IsDeleted)) | |
throw new Exception("Space category already exists!"); | |
SpaceCategory newCategory = _mapper.Map<SpaceCategory>(model); | |
_context.SpaceCategories.Add(newCategory); | |
await _context.SaveChangesAsync(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment