Ejemplo n.º 1
0
        public static BookListing New(string title, string description, double price)
        {
            var newId   = Guid.NewGuid().ToString();
            var listing = new BookListing(newId, title, description, price, DateTimeOffset.Now, null);

            return(listing);
        }
        public static BookListingTableEntity FromEntity(BookListing entity)
        {
            var tableEntity = new BookListingTableEntity(entity.Id);

            tableEntity.Price       = entity.Price;
            tableEntity.Title       = entity.Title;
            tableEntity.Description = entity.Description;
            tableEntity.PublishedOn = entity.PublishedOn;

            return(tableEntity);
        }