public class FSFileInfo
{
public virtual int Id { get; set; }
public virtual int DirectoryId { get; set; }
public virtual string DirectoryName { get; set; }
public virtual string FileName { get; set; }
public virtual DateTime CreationTime { get; set; }
public virtual string Extension { get; set; }
public virtual string FullName { get; set; }
public virtual DateTime LastAccessTime { get; set; }
public virtual DateTime LastWriteTime { get; set; }
public virtual long Size { get; set; }
public virtual DateTime InsertionTime { get; set; }
public virtual string Content { get; set; }
public virtual DateTime ContentUpdateDate { get; set; }
public virtual bool HasPID { get; set; }
public virtual string GDPRWords { get; set; }
public virtual string CachePath { get; set; }
public virtual IList<FSFileInfoDictionary> FSFileInfoDictionary { get; set; }
public virtual int UniquePids
{
get { return FSFileInfoDictionary.DistinctBy(x => x.Dictionary.PIDId).Count(); }
}
public FSFileInfo()
{
FSFileInfoDictionary = new List<FSFileInfoDictionary>();
}
}
class FilesMap : ClassMap<FSFileInfo>
{
public FilesMap()
{
Id(x => x.Id).Column("ID");
Map(x => x.DirectoryId);
Map(x => x.Size);
Map(x => x.CreationTime);
Map(x => x.InsertionTime);
Map(x => x.LastAccessTime);
Map(x => x.LastWriteTime);
Map(x => x.DirectoryName);
Map(x => x.Extension);
Map(x => x.FullName);
Map(x => x.FileName);
Map(x => x.Content);
Map(x => x.ContentUpdateDate);
Map(x => x.HasPID);
Map(x => x.GDPRWords);
Map(x => x.CachePath);
HasMany(x => x.FSFileInfoDictionary)
.KeyColumn("FileID")
.Inverse()
.Cascade.All()
.Not.LazyLoad()
.Fetch.Select();
Table("FSFileInfo");
}
}
class FSFileInfoDictionaryInfoMap : ClassMap<FSFileInfoDictionary>
{
public FSFileInfoDictionaryInfoMap()
{
//LazyLoad();
Id(x => x.Id);
Map(x => x.FileId);
Map(x => x.DictionaryId);
References(x => x.Dictionary).Column("DictionaryId").Not.LazyLoad();
Table("FSFileInfoDictionary");
}
}
class FSDictionaryInfoMap : ClassMap<FSDictionary>
{
public FSDictionaryInfoMap()
{
Id(x => x.Id);
Map(x => x.Word);
Map(x => x.PIDId);
Map(x => x.DateAdded);
Map(x => x.AddedBy);
References(x => x.PID).Column("PIDId").Not.LazyLoad();
Table("FSDictionary");
}
}
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2017
(142)
-
▼
September
(53)
- Returning a file to View/Download in ASP.NET MVC
- Converting string to byte array in C#
- How to set the filename when downloading a file?
- Fluent NHibernate and Collections Mapping
- NHibernate serializing lazy-loaded entities
- Bootstrap Dropdowns
- nhibernate class mappings
- Authorize Attribute with Multiple Roles
- Displaying Labels using Bootstrap
- How to search sql server database for string?
- Edit Metadata of PDF File with C#
- Right pad a string with variable number of spaces
- How can I check if an SQL result contains a newlin...
- How do you specify a different port number in SQL ...
- Hello World PDF.JS Walkthrough
- CAST and CONVERT (Transact-SQL)
- Windows search - full text search in c#
- How to configure fluent nHibernate with MySQL
- Cannot resolve the collation conflict between “SQL...
- SYSDATETIME (Transact-SQL)
- Mapping to collection in PetaPoco?
- Extract key/values from FormCollection in ASP.NET ...
- NHibernate Insert Into Table
- Need help with delete record in asp.net using Nhib...
- Why isn't NHibernate deleting from the database?
- PetaPoco
- How to create a SQL Server stored procedure with p...
- Reading PDF documents in .Net
- Read/Modify PDF Metadata using iTextSharp
- Google Cloud Print using C#
- NHibernate - Fluent Hibernate
- How get data from table with NHibernate by where?
- Cannot convert expression type 'NHibernate.IQueryO...
- MVC If statement in View
- How do I get request parameters in ASP.NET MVC
- Convert file path to a file URI?
- ASP.NET Actionlink with glyphicon and text with di...
- Center a column using Twitter Bootstrap 3
- NHibernate QueryOver distinct
- How use Distinct in linq & linq to NHibernate by s...
- MVC 4 how pass data correctly from controller to view
- Multiple Models in Single View in MVC
- How to retrieve form values from HTTPPOST, diction...
- How to get DropDownList SelectedValue in Controlle...
- Adding SelectListItem manually to SelectList to us...
- How to cache data in a MVC application
- Searching with a dropdown list in asp.net MVC
- Cannot convert type 'System.Collections.Generic.Li...
- Cannot get distinct values using a SelectListitem
- How to return PDF to browser in MVC?
- Show menu item only for logged-on users
- Generate GUID in MySQL for existing Data?
- How do I redirect to the previous action in ASP.NE...
-
▼
September
(53)
No comments:
Post a Comment
Note: only a member of this blog may post a comment.