Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "f0rza"

Works! Many thanks :)

Have update on this. Found workaround solution here: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/586">https://github.com/aspnetboilerplate/as ... issues/586</a>

Done as follows:

public partial class Articles_T : IEntity<int>

and

#region Implementation of IEntity<int>

        public bool IsTransient()
        {
            return false;
        }

        [NotMapped]
        public int Id { get { return Articles_ID; } set { Articles_ID = value; } }

        #endregion

When execute

Articles_T art = artAppService.Get(articleId);

Get error:

An exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll but was not handled in user code

Additional information: The specified type member 'Id' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.

Generated using Code-First templates. Seems that problem solved.

But currently have another issue:

IRepository<> accepts type inherited from Entity which defines primary column as 'Id' int.

Tables in my DB uses different names: ID, [TableName]Id etc

Is it possible to override this ?

Showing 1 to 3 of 3 entries