public static Table.Category Map(this Model.Category category)
        {
            var tableCategory = new Table.Category
            {
                name = category.Name
            };

            return(tableCategory);
        }
        public static Table.Category Map(this Model.Category category)
        {
            var tableCategory = new Table.Category
            {
                name = category.Name
            };

            return tableCategory;
        }
        public static Model.Category Map(this Table.Category category, int filmCount = 0)
        {
            var domainCategory = new Model.Category
            {
                CategoryId = category.category_id,
                FilmCount  = filmCount,
                Name       = category.name,
                lastUpdate = category.last_update
            };

            return(domainCategory);
        }
Beispiel #4
0
 /// <summary>
 /// Map only basic info available in table model
 /// </summary>
 /// <param name="actor"></param>
 /// <returns></returns>
 public static Model.Actor Map(this Table.Actor actor,
                               Table.Category mostPlayedCategory, IEnumerable <Table.Film> longestFilms, int filmCount)
 {
     return(new Model.Actor {
         Id = actor.actor_id,
         FirstName = actor.first_name,
         LastName = actor.last_name,
         MostPLayedFilmCategory = mostPlayedCategory.Map(),
         FilmCount = filmCount,
         ThreeLongestFilms = longestFilms.Map()
     });
 }