Example #1
0
        public async Task <int> UpdatePlaceAsync(Place place)
        {
            if (place.place_id > 0)
            {
                _dataSource.Entry(place).State = EntityState.Modified;
            }
            else
            {
                place.place_id = UIDGenerator.Next();
                place.reg_dt   = DateTime.UtcNow;
                _dataSource.Entry(place).State = EntityState.Added;
            }
            place.upd_dt      = DateTime.UtcNow;
            place.searchterms = place.BuildSearchTerms();
            int res = await _dataSource.SaveChangesAsync();

            return(res);
        }