public static TagModel ToModel(Tag tagEntity) { TagModel tagModel = new TagModel() { ID = tagEntity.ID, Name = tagEntity.Name, PostsCount = tagEntity.Posts.Count }; return tagModel; } }