예제 #1
0
        public Location Create(Location location)
        {
            if (location.Id == Guid.Empty)
            {
                location.Id = Guid.NewGuid();
            }

            using (var connection = context.CreateConnection())
            {
                connection.Execute(LocationQuery.Insert(location));
                return(location);
            }
        }
예제 #2
0
        public async Task <Location> CreateAsync(Location location)
        {
            if (location.Id == Guid.Empty)
            {
                location.Id = Guid.NewGuid();
            }

            using (var connection = context.CreateConnection())
            {
                await connection.ExecuteAsync(LocationQuery.Insert(location));

                return(location);
            }
        }
예제 #3
0
        public void InsertList([FromBody] List <Location> data)
        {
            var query = new LocationQuery();

            query.Insert(data);
        }