2014-04-15 45 views
0

我读了很多abuot存储与attatchments图像。但我想知道在ravenDb中存储image-INFO的正确方法是什么。所以我可以使用这些信息并从一些在线存储中获取图像。 我想我需要的路径..也许,有,身高等......那么在乌鸦dbDocument中做这件事的正确方法是什么?正确的方式来存储图像信息在RavenDb不使用attatchments

回答

1

不知道更多关于你的要求,我的基本回答是这样的:

public class Image 
{ 
    /// <summary> 
    ///  Gets or sets the original name of the Image. 
    /// </summary> 
    public string FileName { get; set; } 

    /// <summary> 
    ///  Gets or sets the physical location of the Image 
    /// </summary> 
    public string Location {get; set;} 

    /// <summary> 
    ///  Gets or sets the size of the file. 
    /// </summary> 
    public long FileSize { get; set; } 

    /// <summary> 
    ///  Gets or sets the MIME type of the file. 
    /// </summary> 
    public string MimeType { get; set; } 

    /// <summary> 
    ///  Gets or sets the Width, in pixels, of the Image 
    /// </summary> 
    public int Width { get; set; } 

    /// <summary> 
    ///  Gets or sets the Height, in pixels, of the Image 
    /// </summary> 
    public int Height { get; set; } 

    /// <summary> 
    ///  Gets or sets the thumbnails. 
    /// </summary> 
    /// <value> 
    ///  The thumbnails. 
    /// </value> 
    public ICollection<Thumbnail> Thumbnails { get; protected set; } 

    /// <summary> 
    /// Gets or sets the last Thumbnail id. 
    /// </summary> 

    public int LastThumbnailId { get; set; } 

    /// <summary> 
    /// Generates the new Thumbnail id. 
    /// </summary> 
    /// <returns></returns> 
    public int GenerateNewThumbnailId() 
    { 
     return ++LastThumbnailId; 
    } 
} 

public class Thumbnail 
{ 
    /// <summary> 
    /// Gets or sets the Thumbnail id. 
    /// </summary> 
    public int Id { get; set; } 

    /// <summary> 
    ///  Gets or sets the Width, in pixels, of the Thumbnail 
    /// </summary> 
    public int Width { get; set; } 

    /// <summary> 
    ///  Gets or sets the Height, in pixels, of the Thumbnail 
    /// </summary> 
    public int Height { get; set; } 

    /// <summary> 
    ///  Gets or sets the physical location of the Thumbnail 
    /// </summary> 
    public string Location {get; set;} 
} 
相关问题