vgquotes/Src/VideoGameQuotes.Api/Category.cs
tmont 14ca315213 * dto madness
* api madness
* browse page is beginning to not be empty
* NetVotes -> Score
2011-02-16 02:48:11 +00:00

29 lines
676 B
C#

using System;
using System.ComponentModel.DataAnnotations;
using Portoa.Persistence;
namespace VideoGameQuotes.Api {
public class Category : Entity<Category, int>, IDtoMappable<CategoryDto> {
public Category() {
Created = DateTime.UtcNow;
}
public virtual DateTime Created { get; set; }
[Required, StringLength(255)]
public virtual string Name { get; set; }
public virtual CategoryDto ToDto() {
return new CategoryDto {
Id = Id,
Created = Created,
Name = Name
};
}
}
public class CategoryDto {
public int Id { get; set; }
public DateTime Created { get; set; }
public string Name { get; set; }
}
}