This question is locked. New answers and comments are not allowed.
Hi everybody,
This is my first post on this forums.
I am using Openaccess Orm Fluent API for six months using mvc and i hadn't had any problem on two projects. Now get an error on an Asp.net project.
Following the documentation i usually set up an object like this:
and i configure the Metadata source like this
The Table pcarchi is defined like this
When i try to get a SampleItem i always get this error:
It always add a ..._id column to select statement. Is there a particular configuration that i have to set in order to make it work?
Thanks in advance
Filippo
This is my first post on this forums.
I am using Openaccess Orm Fluent API for six months using mvc and i hadn't had any problem on two projects. Now get an error on an Asp.net project.
Following the documentation i usually set up an object like this:
public class SampleItem { public int gid { get; set; } public string Userins { get; set; } public string Usermod { get; set; } public DateTime Dateins { get; set; } public DateTime Datemod { get; set; } }and i configure the Metadata source like this
MappingConfiguration<SampleItem> sampleItemConfiguration = new MappingConfiguration<SampleItem>(); sampleItemConfiguration.MapType(x => new { gid = x.gid, userins = x.Userins, usermod = x.Usermod, dateins = x.Dateins, datemod = x.Datemod }).ToTable("pcarchi"); sampleItemConfiguration.HasProperty(x => x.gid).IsIdentity(KeyGenerator.Autoinc); sampleItemConfiguration.HasProperty(x => x.gid).IsNotNullable(); sampleItemConfiguration.HasProperty(x => x.Dateins).IsNotNullable(); sampleItemConfiguration.HasProperty(x => x.Datemod).IsNotNullable(); sampleItemConfiguration.HasProperty(x => x.Userins).IsNotNullable(); sampleItemConfiguration.HasProperty(x => x.Usermod).IsNotNullable();The Table pcarchi is defined like this
CREATE TABLE pcarchi( gid serial NOT NULL, userins character varying(50) NOT NULL, usermod character varying(50) NOT NULL, dateins timestamp without time zone NOT NULL, datemod timestamp without time zone NOT NULL CONSTRAINT ccarchi_pkey PRIMARY KEY (gid))WITH ( OIDS=FALSE);When i try to get a SampleItem i always get this error:
SELECT a."pcarchi_id" AS COL1, a."dateins" AS COL2, a."datemod" AS COL3, a."userins" AS COL4, a."usermod" AS COL5, a."gid" AS COL6 FROM "pcarchi" AS a ORDER BY COL2 DESC, COL1 Telerik.OpenAccess.RT.sql.SQLException: ERROR: 42703: column a.pcarchi_id does not existIt always add a ..._id column to select statement. Is there a particular configuration that i have to set in order to make it work?
Thanks in advance
Filippo