Exemple #1
0
        public async Task <bool> CreateArtist(ArtistResource artist)
        {
            var entity =
                new Artist()
            {
                Name        = artist.Name,
                Description = artist.Description
            };

            using (var context = new OneOffEntities())
            {
                context.Artists.Add(entity);
                return(await context.SaveChangesAsync() == 1);
            }
        }
Exemple #2
0
        public async Task <bool> CreateVenue(VenueResource venue)
        {
            var entity =
                new Venue()
            {
                Name        = venue.Name,
                Description = venue.Description,
                PostalCode  = venue.PostalCode
            };

            using (var ctx = new OneOffEntities())
            {
                ctx.Venues.Add(entity);
                return(await ctx.SaveChangesAsync() == 1);
            }
        }