Example #1
0
        public async Task <StockSectorModel> AddSector(StockSectorModel sectorModel)
        {
            var sector = new STOCK_SECTOR
            {
                SECTOR_NAME = sectorModel.SectorName
            };

            dbContext.StockSectors.Add(sector);
            await dbContext.SaveChangesAsync();

            return(new StockSectorModel {
                SectorName = sector.SECTOR_NAME, SectorId = sector.STOCK_SECTOR_ID
            });
        }
Example #2
0
 public async Task <StockSectorModel> AddSector(StockSectorModel sector)
 {
     return(await stockSectorRepository.AddSector(sector));
 }