public async Task Create(Shop shop) { if (shop is null) { throw new ArgumentNullException("shop doesn't exist"); } await _shopRepository.Create(shop); }
public async Task <object> Create([FromBody] ShopViewModel shopViewModel) { Shop shop = new Shop(); try { shop = _shopRepository.Create(shopViewModel); } catch (Exception ex) { result = false; error = ex.Message; } return(new SingleResponse <Shop> { Message = "Shop created successfully", DidError = false, ErrorMessage = string.Empty, Token = string.Empty, Model = shop }); }