vgquotes/Src/VideoGameQuotes.Api/Category.cs

29 lines
666 B
C#
Raw Normal View History

2011-02-12 23:54:52 +00:00
using System;
using System.ComponentModel.DataAnnotations;
using Portoa.Persistence;
namespace VideoGameQuotes.Api {
2011-03-07 20:56:34 +00:00
public class Category : Entity<int>, IDtoMappable<CategoryDto> {
2011-02-12 23:54:52 +00:00
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; }
2011-02-12 23:54:52 +00:00
}
}