Code Monkey home page Code Monkey logo

entityspaces's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

entityspaces's Issues

EntitySpaces Studio generates buggy code for references to other classes

Hi,
this is the code generated by ES Studio for the Kunden property of my auftraege Class:

public Kunden Kunden
{
	get
	{
		if (this._Kunden == null)
		{
			this._Kunden = new Kunden();
			this._Kunden.es.Connection.Name = this.es.Connection.Name;
			this.SetPreSave("Kunden", this._Kunden);

			if(this._Kunden == null && FkKunden != null)
			{
				if (!this.es.IsLazyLoadDisabled)
				{
					this._Kunden.Query.Where(this._Kunden.Query.IdKunden == this.FkKunden);
					this._Kunden.Query.Load();
				}
			}
		}

		return this._Kunden;
	}
	
	set
	{
		this.RemovePreSave("Kunden");
		

		if(value == null)
		{
			this.FkKunden = null;
			this._Kunden = null;
		}
		else
		{
			this.FkKunden = value.IdKunden;
			this._Kunden = value;
			this.SetPreSave("Kunden", this._Kunden);
		}
		
	}
}

The getter returns allways an empty Kunden class because of the if(this._Kunden == null && FkKunden != null) check which is allways false because this._Kunden is empty but not null. The check should be if (!this._Kunden.es.HasData && this.FkKunden != null) to work properly.

BTW: This is a show stopper!

Problem with Query from entity

Hi guys,
I get error from compiler when i implement this query:
Department x = (Department)mDepHigher.GetSelectedDataRow();
Department y = new Department();
y.Query.Where(y.Query.DeptParentCode == x.DeptParentCode && y.DeptName == mDepLower.Name);

The compiler said:

error CS0019: Operator '&&' cannot be applied to operands of type 'esComparison' and 'bool'

But it is OK when my codes are:
Department x = (Department)mDepHigher.GetSelectedDataRow();
DepartmentQuery d = new DepartmentQuery();
DepartmentCollection cd = new DepartmentCollection();
d.Where(d.DeptParentCode == x.DeptParentCode && d.DeptName == mDepLower.Text);

can you tell me what i was wrong in the fist code?
Thanks

Garbage collection with Using or Dispose

Hi, I just get this error : The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached on an ASP.NET application that rely heavily on EntitySpaces.
Is that open/close db connection automatically disposed? so we should be bother to use Using "Bracket" to dispose? or there is any way to safely dispose unused connection, whether it is successfully executed or triggered an exception?
Thank You.

Exception "incorrect syntax near 'TSEQUAL' when setting dbversion to 2012

Hi,
when using DatabaseVersion = "2012" as noticed in the project description saving data raises the exception from the title because in Providers\EntitySpaces.SqlClientProvider\Shared.cs the version check is only for if (request.DatabaseVersion == "2005" || request.DatabaseVersion == "2008") (line 360 and 490).

Use two different provider, i.e : Mysql and SqlServer

Back then before the ES assemby for each provider merged as EntitySpaces.ORM.SqlServer, or EntitySpaces.ORM.MySql, I could use both database in single project, but now when i install both EntitySpaces.ORM.SqlServer and EntitySpaces.ORM.MySql assembly, it no longer works. Is there a solution to enable multiple connection to different database type like old time?
Thank You very much.

Best Regards,

Toro

EntitySpaces Studio generates buggy classes for views

Version 2019.1.1218.0 of EntitySpaces Studio generates buggy code for view clases.

Every generated view class gets at least a constructor which requires a join alias but the GetDynamicQuery or Query methods of the same generated classes are calling a non existing constructor without parameters.

Type expected / Identifier Expected (Lacking Parameters)

Hi Mike,

First, here are the versions I have, if needed:

  • EntitySpace Studio 2019.1.0828.0
  • Visual Studio 2019
  • .Net Core 3.0

I was generating from the C# template and got this error:
image

It seems that there were some lacking parameters.

I tried to remove the "," and set it only with the esSqlAccessType sqlAccessType and it seems to compile fine. Need to test yet on runtime.

Vb Generated Classes Master Error

Hi Mike,
I was very excited to see ES 2019 now available on GitHub. I've just downloaded all the components to upgrade an existing 2012 ES application which was written in VB.

When I tried to generate the entities in ES Studio, the Custom entities were fine, however I get the following error for the Generated entities (note: I tried generating the entities in C# and got no errors for both Custom and Generated - this looks to be an issue with VB only).

Error Found in C:\Program Files (x86)\EntitySpaces 2019\CodeGeneration\Templates\EntitySpaces\VB\Generated\Generated - esEntity (VB).est on line 245
No overload for method 'EntityRelationName' takes 3 arguments

Error Found in C:\Program Files (x86)\EntitySpaces 2019\CodeGeneration\Templates\EntitySpaces\VB\Generated\Generated - esEntity (VB).est on line 303
No overload for method 'EntityRelationName' takes 3 arguments



   at EntitySpaces.CodeGenerator.Template.Execute(Root esMeta, String templateLocation)
   at EntitySpaces.AddIn.ucTemplates.OnExecute(TemplateDisplaySurface surface)

Waiting for fix of Studio items

Hi Mike
I am migrating from EntitySpaces 2009 (!) to your newest version 2019/2020.
Now I fell across one of the bugs reported by HeikoAdams on Feb 24th.
I fixed the templates according to his "cookbook".
Have you been able to build a new installable version of the studio by now?
Best regards and looking forward...
Thomas

EntitySpaces Studio Connection reverts to Northwind when you save project

I'm using v2019.1.1218.0

On the second time I save a project, the connection string reverts to this -

Provider=SQLOLEDB.1;Password=;User ID=sa;Persist Security Info=True;Initial Catalog=Northwind;Data Source=localhost

To reproduce -

  1. Launch EntitySpaces Studio
  2. Right click on "Project" and select "Record a Template"
  3. Choose Templates > EntitySpaces > 2019 > C# > Generated - Classes Master (C#)
  4. Click "Save As" and save the project to a file - inspect the file. You can inspect the file and it has the correct connection string at this stage - it will be the one you saved as default under the global settings
  5. Now click "Save" - at this stage, the esprj file is copied to an _original.esprj file and if you inspect the newly saved file, you can see that the connection string has reverted to the Northwind one

Studio - error when open a previously created proyect

When I create a new proyect and add themplates, generated code and save the project
all works ok

BUT, when I open the previously created project file, I get this error
And I coludn't open the project file
and I must start from zero, :-(

I tested also with Studio version EntitySpacesStudio_20191.1218.0
and the error occurs too

thanks in advance

image

Error Message
Object reference not set to an instance of an object.

at EntitySpaces.MetadataEngine.esSettings2010.SetDefaultSettings()
at EntitySpaces.Common.esProject2010.Load(String fileNameAndFilePath, esSettings mainSettings)
at EntitySpaces.Common.esProject.ConvertProject(String fileNameAndFilePath, esSettings settings)
at EntitySpaces.Common.esProject.Load(String fileNameAndFilePath, esSettings mainSettings)
at EntitySpaces.AddIn.ucProjects.OpenProject(String fileNameAndPath)

Use cases for using EntitySpaces.

EntitySpaces was a great tool in 2007-2008, when MS entity framework wasn’t available yet, and our legacy application still use it for a few tables. But when will you recommend to use it now? Is it only for upgrading old applications, that are using original ES? Or you suggest to use in in new applications as well?. Please add the answer to readme.md, as it will be interesting to all readers.
Btw, why did you create this repository under new name, not under EntitySpaces? It will be better to cross-link old and new EntitySpaces repositories.

Missing backward compability

Hello,
I'm currently porting our application to the current version of entity spaces and running in some problems:

  • The Sort string-property of collections seems to be missing
  • The Filter property was of type string but now it's an IQueryable
  • The HasData property seems to be missing (I've replaced it with "== default" or "!= default")
  • The AddNew Method is gone. How to replace it?
  • The QueryReset Method is gone. How to replace it?

These are showstopper for us!

Creating generated code using entity space 2019 producing this error for tables with out a primary key.

Table with no primary key produces an error in the generated file like below:

		public virtual bool LoadByPrimaryKey(esSqlAccessType sqlAccessType, )
		{
			if (sqlAccessType == esSqlAccessType.DynamicSQL)
				return LoadByPrimaryKeyDynamic();
			else
				return LoadByPrimaryKeyStoredProcedure();
		}

Since we're working with a table with out any key here.. is it safe to simply remove this method from the generated file?

Migrating from Entityspaces 2009 to 2020

Hey not an issue, but do you have a guide on how to migrate from EntitySpaces 2009 to 2020? We're still using 2009 it for our main product (putting off and finding excuses not to go to EF for years).

Setting Connection dynamicly

I'm pleasantly surprised to discover ES is alive! Was a long time supporter/user, actually still using ES 2012.

I'm now trying to re-use my currently created ES objects from our ASP application which we are migrating to MVC with the new version of ES, so far only minor changes have needed to be done to some custom classes but the generated classes are working as is, so far. What I'm running into is an issue trying to figure out how to dynamically set the ES objects connection. Our application is basically a multi-tenant application and needs to set the connection based on who is logged in. I was thinking I could use the EntitySpaces.Interfaces.esConnection.ConnectionService but that doesn't seem to be working. I know I could set the connection in the Global.asax file but like I said I need the connection to be dynamically set. Was hoping for some pointers on the best was to accomplish this in an MVC application using ES. I'm guessing I could set the EntitySpaces.Interfaces.esConnectionElement when users log into the system but not sure that's the best way?

Side note: I used to be able to set the connection name on the classes also and that isn't working either.
collection.es.Connection.Name = connectionName and the connection name we were setting would be one of the connection names set in the webconfig file in the EntitySpaces section. But from the documation website it doesn't look like we can set that up and use that method anymore?

Thanks,

Hierarchical template for One-To-One & self references

Hi,
As a long time user of EntitySpaces 2012, I've just yesterday found out that there is a new version available since 2019/2020 and I was very pleased to see that such a good product was revived.
But I'm having a problem with the Hierarchical template for One-To-One relationships between 2 tables and for self referencing tables (as eg the parent of an item).
Upon compilation of the generated tables I get the CS0542 error: 'member names cannot be the same as their enclosing type'.
Upon examination, the property name for the referencing object is the same as the class name it is defined in (see resulting code below).

public partial class TblSitesSalesInfo : esTblSitesSalesInfo
{
	#region TblSitesSalesInfo - One To One (tblSitesSalesInfo_FK00)
		
	[EditorBrowsable(EditorBrowsableState.Never)]
	public bool ShouldSerializeTblSitesSalesInfo()
	{
		return (this._TblSitesSalesInfo != null) ? true : false;
	}

	[DataMember(Name="TblSitesSalesInfo", EmitDefaultValue = false)]
	public TblSites TblSitesSalesInfo
	{
		get
		{
			......

[In the class TblSiteSalesInfo it needs to create a reference to an object of type TblSites, but the property name is TblSiteSalesInfo instead of TblSites or the alias given in the MetaData]

I've already browsed through all open and closed issues, have given the foreign key relationship a different alias as suggested in issue #4 and tried correcting the Hierarchical template myself, but I've not found a solution for this.

Can anyone please help me?
Thanks

Mark Metadata's ColumNames class as static

The ColumnNames class of the Metadata Class can be marked as static by canging line 216 of Generated - Metadata (C#).est from public class ColumnNames to public static class ColumnNames

Problem with the generated code for many to one property

I have this generated code for a table called products created by the ES 2019 studio.
The table products has a many to one relationship with a table called categories.

I want to be able to access the name of the category from product.
So I am doing product.categories.category_name
But when I step through the code in the generated file:, I never seem to reach the part where it loads the Categories.

The generated code in 2019 looks like this:

image

Is this a bug? Is there some other way I need to be doing this?

I think the problem is with this line:
if(this._Categories == null && CategoryId != null)

image
This is causing it to never go in to that if block since we have already initialized this._Categories just before that:
this._Categories = new Categories();

In 2009 version it used to work fine.
The code in 2009 like this:
image

Please let me know if anyone have any solution for this. Thank you!

Entityspaces 2009 - UdtTypeName property must be set for UDT parameters issue

Can anyone who is using Entityspaces 2009 help me out with UdtTypeName property must be set for UDT parameters issue? My site is all working fine until I migrated my database from SQL 2005 to SQL 2016. See below for error details. Many thanks for your help in advance.

[ArgumentException: UdtTypeName property must be set for UDT parameters.] EntitySpaces.Interfaces.esDataProvider.esLoadDataTable(esDataRequest request, esProviderSignature sig) +106 EntitySpaces.Interfaces.esDynamicQuery.Load() +496 EntitySpaces.Core.esEntityCollection.LoadAll() +42 _Default._Default_Load(Object sender, EventArgs e) in h:\root\home\teddyli-001\www\eggs\Default.aspx.vb:15 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

VDB3 Support

Hi Mike, I am a long time user and fan of Entity Spaces. I was just googling Entity Spaces documentation and found that you had continued working on it. Yay! I much prefer it to Entity Framework and have a lifetime's worth of code built around it.

I am still using the VistaDB3 files. Will the new version work with that?

PostgreSQL solution build failing in Visual Studio 2019 Community version

Errors while trying to build the solution.

The type or namespace name 'IOverClause' could not be found (are you missing a using directive or an assembly reference?) EntitySpaces.ORM.PostgreSQL (net451), EntitySpaces.ORM.PostgreSQL (net461), EntitySpaces.ORM.PostgreSQL (netcoreapp2.0), EntitySpaces.ORM.PostgreSQL (netcoreapp3.0), EntitySpaces.ORM.PostgreSQL (netstandard2.0)

Character ' ', hexadecimal value 0x3 is illegal in XML documents. EntitySpaces.ORM.PostgreSQL

image

Cannot refresh views

Hi Mike, I hope this ping finds you well.

I am trying to add a new View to the studio, but I cannot figure out how to reload it.
Could you share detail on how to add or update the database and EntitySpaces to see the changes?

Member names cannot be same as their enclosing type

Hi Mike,

First here are the versions I am using (not sure if some of them are related):

  • EntitySpace Studio 2019.1.0828.0
  • Visual Studio 2019
  • .Net Core 3.0

I am generating from the C# template on the ES Studio 2019. After compiling I got this error:
image

But not every entity gets this error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.