Note that there are some explanatory texts on larger screens.

plurals
  1. POGet "No persister for" Error in Fluent NHibernet
    primarykey
    data
    text
    <p>I am new in Fluent NHibernet and i am using Fluent NHibernet in my asp.net application </p> <p>this is my Poco class</p> <pre><code>public virtual int CategoryId { get; set; } public virtual string CategoryName { get; set; } public virtual bool IsActive { get; set; } public virtual bool IsDeleted { get; set; } </code></pre> <p>My Mapping Class</p> <pre><code> public class clsCategoryMap : ClassMap&lt;clsCategory&gt; { public clsCategoryMap() { Id(x =&gt; x.CategoryId).Column("CategoryId").GeneratedBy.Assigned().Not.Nullable(); Map(x =&gt; x.CategoryName).Column("CategoryName").Not.Nullable(); Map(x =&gt; x.IsActive).Column("IsActive").Not.Nullable(); Map(x =&gt; x.IsDeleted).Column("IsDeleted").Not.Nullable(); Table("tblCategory"); } } </code></pre> <p>Poco class and Mapping class both saprated in class Liberar like: DAL for Poco class and BLL For Mapping class.</p> <p>And i create helper class it's below:</p> <pre><code>public class FNHelper { private static ISessionFactory _sessionfactory; private static ISessionFactory SessionFactory { get { if (_sessionfactory == null) { InitializationSessionFactory(); } return _sessionfactory; } } private static void InitializationSessionFactory() { _sessionfactory = Fluently.Configure() .Database( MsSqlConfiguration.MsSql2008 .ConnectionString(@"Server=test\SQLEXPRESS;Database=TestDB;User ID=sa;Password=root;") .DefaultSchema("dbo") .ShowSql() ) .Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf&lt;clsCategory&gt;()) .ExposeConfiguration((cfg =&gt; new SchemaUpdate(cfg).Execute(true, true))) .BuildSessionFactory(); } public static ISession OpenSession() { return SessionFactory.OpenSession(); } private static void BuildSchema(NHibernate.Cfg.Configuration configuration) { String SqliteRefFileName = @"D:\Projects\MeshpsDB.sql"; if (File.Exists(SqliteRefFileName)) File.Delete(SqliteRefFileName); new SchemaExport(configuration) .Create(true, true); } } </code></pre> <p>And finally i am doing in my form it's below:</p> <pre><code>protected void btnSave_Click(object sender, EventArgs e) { using (var session = FNHelper.OpenSession()) { using (var tranction = session.Transaction) { var objCategory = new clsCategory { CategoryId = 0, CategoryName = txtName.Text.Trim(), IsActive = true, IsDeleted = false }; session.Save(objCategory); tranction.Commit(); } } } </code></pre> <p>when i click on button then i am getting</p> <p><img src="https://i.stack.imgur.com/uGMWa.png" alt="enter image description here"></p> <p>so every one please tell me how can i solve this issue. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload