This project is read-only.

Customize Select method in EFEntityDAODase

Mar 3, 2012 at 11:43 AM

Hi, 

I have two entities: Customer and City.

My Customer entity has the properties: City and CityId.

I also have CustomerDAO and I wish that my select method return the name of the city and not just the ID.

I saw that the city property is not loaded.

It´s possible to add this requirement without override the select method?

Thanks in advance,

Sebastian

Mar 3, 2012 at 12:12 PM

Hi Sebastian,

I would add a custom property to the Entity class for CityName.

Add it to the partial Entity class in your Business Logic Layer, not the one generated by Entity Framework.

partial public class Customer

{

    public string CityName

    {

         get { return City.Name; }

    }

}

Also Sebastian, I would like to know more about your experience with Versatile DataSources. I am about to release a much better implementation of the same idea in my commercial product, Peter's Data Entry Suite, and want to learn what I can to make it more appealing to customers like you. Would you either post here or contact me directly at pblum @ peterblum.com (omit the spaces please).

Mar 5, 2012 at 2:09 PM

Hi Peter,  

Thank you very much for the answer! It has been very helpful to me.

Regarding my experience with Versatile DataSources, I started doing some proof of concept with Dynamic Data and I found this product very interesting because allowed me to combine in a better way things that use dynamic data with things that do not.

Based on what I read, I noticed that it is possible to use POCO objects, but I still cannot make any proof of concept about it. As soon as I can test this, I tell about my experience.

Regards,

Sebastian

 

Mar 5, 2012 at 2:30 PM
Hi Sebastian,

Given its still early in your development efforts, you will really benefit
from evaluating my commercial work because it's a replacement to Dynamic
Data. It was originally built as an extension to Dynamic Data, but over the
development process, I discovered many design issues within Dynamic Data
that prevented me from continuing to use its code. I also wanted to address
the Business Logic Layer far more aggressively. With Versatile Data Sources,
you are seeing part of that work: a DataSource that enforces putting the
CRUD business logic in the Business Logic Layer. I also greatly expanded the
DataAnnotation attributes, adding far more capabilities to what Microsoft
ships in System.ComponentModel.DataAnnotations and introducing so many new
options.

Please visit this prerelease Guided Tour to learn more:
http://learnbld.peterblum.com/guided tour.aspx

If you want to try it out, contact me via email (plblum @ peterblum.com
omitting the spaces) and I can provide you with the beta, which includes a
huge amount of documentation.

--- Peter Blum
www.PeterBlum.com