コード例 #1
0
        public async Task <string> Post([FromBody] Station Station)
        {
            var nombre = Station.Name;

            var x = await _StationRepository.Add(Station);

            if (x == false)
            {
                return("Id already exists!");
            }

            return("");
        }
コード例 #2
0
ファイル: StationService.cs プロジェクト: Tuandl/ResellTicket
        public bool CreateStation(StationCreateViewModel model)
        {
            if (_StationRepository.Get(x => x.Deleted == false && x.Name.ToLower().Equals(model.Name.ToLower())
                                       ) == null)
            {
                var station = new Station();
                station.Name         = model.Name;
                station.CityId       = model.CityId;
                station.CreatedAtUTC = DateTime.UtcNow;
                _StationRepository.Add(station);
                _unitOfWork.CommitChanges();

                return(true);
            }
            return(false);
        }
コード例 #3
0
 public Task Add(Station station) => _stationRepository.Add(station);
コード例 #4
0
        //public Category GetCategory(int id)
        //{
        //    var category = categorysRepository.GetById(id);
        //    return category;
        //}

        //public Category GetCategory(string name)
        //{
        //    var category = categorysRepository.GetCategoryByName(name);
        //    return category;
        //}

        public void CreateStation(TBL_STATION station)
        {
            stationRepository.Add(station);
        }
コード例 #5
0
ファイル: StationService.cs プロジェクト: kemora08/MyRadio
 public Station Add(Station newStation)
 {
     return(_stationRepository.Add(newStation));
 }