Blog Files model
This commit is contained in:
parent
40e8e08690
commit
bfb37bc214
12 changed files with 318 additions and 173 deletions
59
src/Yavsc.Server/Models/Blog/BlogAttachedFile.cs
Normal file
59
src/Yavsc.Server/Models/Blog/BlogAttachedFile.cs
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Org.BouncyCastle.Crypto.Modes;
|
||||
|
||||
namespace Yavsc.Models.Blog
|
||||
{
|
||||
public class UploadedFile
|
||||
{
|
||||
/// <summary>
|
||||
/// File Identifier
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Display(Name = "Identifiant du fichier")]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// relative path to the file, relative to the poster space prefix
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length
|
||||
/// </summary> <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public long Length { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File Content type
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public string ContentType { get; set; }
|
||||
}
|
||||
public class BlogAttachedFile
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Post Id
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public long FileId { get; set; }
|
||||
|
||||
[ForeignKey("FileId")]
|
||||
public virtual UploadedFile File { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Post Id
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public long PostId { get; set; }
|
||||
|
||||
[ForeignKey("PostId")]
|
||||
public virtual BlogPost Post { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -9,26 +9,6 @@ using Yavsc.Models.Relationship;
|
|||
|
||||
namespace Yavsc.Models.Blog
|
||||
{
|
||||
public class BlogPostEditViewModel : BlogPost
|
||||
{
|
||||
public bool Publish { get; set; }
|
||||
public BlogPostEditViewModel()
|
||||
{
|
||||
}
|
||||
|
||||
public BlogPostEditViewModel(BlogPost post, bool publish)
|
||||
{
|
||||
Id = post.Id;
|
||||
AuthorId = post.AuthorId;
|
||||
Photo = post.Photo;
|
||||
Title = post.Title;
|
||||
Article = post.Article;
|
||||
Publish = publish;
|
||||
ACL = post.ACL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class BlogPost :
|
||||
IBlogPost, ICircleAuthorized, ITaggable<long>
|
||||
|
|
|
|||
23
src/Yavsc.Server/Models/Blog/BlogPostEditViewModel.cs
Normal file
23
src/Yavsc.Server/Models/Blog/BlogPostEditViewModel.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
namespace Yavsc.Models.Blog
|
||||
{
|
||||
public class BlogPostEditViewModel : BlogPost
|
||||
{
|
||||
public bool Publish { get; set; }
|
||||
public BlogPostEditViewModel()
|
||||
{
|
||||
}
|
||||
|
||||
public BlogPostEditViewModel(BlogPost post, bool publish)
|
||||
{
|
||||
Id = post.Id;
|
||||
AuthorId = post.AuthorId;
|
||||
Photo = post.Photo;
|
||||
Title = post.Title;
|
||||
Article = post.Article;
|
||||
Publish = publish;
|
||||
ACL = post.ACL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue