I will like to know that is there a way to exclude some fields from the database? For eg:
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public string FatherName { get; set; }
public bool IsMale { get; set; }
public bool IsMarried { get; set; }
public string AddressAs { get...
Im using the pre release of Ado.Net and can't understand how I use that with Ado.Net Data Service.
The code for the ObjectContext
public class TradingContext : ObjectContext
{
private static TradingContext _Context;
public static TradingContext Current
{
get
{
if (_...
Hi folks,
i'm under the impression that
EF with POCO: allows you to map your own POCO's to the entities on the model (.edmx).
EF Code-Only: no edmx / model designer (ie. CSDL/SSDL/MSL (collectively EDMX) metadata). Still POCO's but the mappings, relationships, navigation, etc are all manually coded (hence the code-only, description).
...
Is their a way using Entity Framework Code-Only to have an entity that has fields from two tables if both tables don't contain the primary key?
Here is an example.
public class BlogPost
{
public int PostID { get; set; }
public String PostBody { get; set; }
public int UserID { get; set; }
public string Username { get; se...
I am trying to setup a project using Entity Framework 4, POCO, and Code-Only.
Is it possible in entity framework for type of a navigation property to be an interface?
I have a "Task" class. A Task can be assigned to a user or a group each of which are represented by a separate class and stored in separate tables. The classes look som...
Is it possible to use "code only" with Entity Framework in an out-of-the box VS2010 Beta 2, or do I need some additional download?
...
Although I have marked my ID column with .Identity(), the generated database schema doesn't have IDENTITY set to true, which gives me problems when I'm adding records. If I manually edit the database schema (in SQL Management Studio) to have the Id column marked IDENTITY, everything works as I want it - I just can't make EF do that by it...
In NHibernate, there is a method doing something like ThisOrThat.VeryfyMappings() (I don't know the exact definition of it since it was a while ago I last tried NHibernate...)
I recall seeing a blog post somewhere where the author showed how to do some similar testing in Entity Framework 4, but now I cant find it. So, how do I test my E...
I cannot find EntityConfiguration.
The same question for RC was here but I thought that it would make it to the RTM version. Is it there?
...
I've been looking at the new Entity Framework 4 Code Only features, and I really like them. But I'm having a hard time finding good resource on the feature. Everything seems to be spread around blongs here and there, so this make me wonder if it's ready to be used for a serious project?
What do you think? Is it ready for production use ...
Hello Everyone
I'm playing around with Entity Framework 4 and code only. The tutorial I'm following is using the Beta-Version of Visual Studio 2010 and is referring to Microsoft.Data.Entity.Ctp.
Since I'm working with the final release of Visual Studio the name of the dll must have changed.
Can somebody tell me how its name is now?
Che...
There's a way?
var customer = constructor.Entity<Customer>();
customer.Property(c => c.Date).DataType("smalldatetime");
THANKS IN ADVANCE
...
I setup the builder and used CreateDatabase to generate the database.
However the table columns created are ordered alphabetically. Is there a way to control the order?
...
This is a bit of a strange one but I've just seen something on twitter which kind of baffled me and I'm interested to know more.
Rob Conery tweeted the following a couple of hours ago: Class name of the day: "Maybe<T>". Method of the day: "ToMaybe<T>()". He then went on to offer a Tekpub coupon to anyone who could guess where it came f...
(This looks like a long question, but it's not really, honest!)
I am trying to get a simple proof of concept working with Entity Framework 4 and the CTP 3 version of Code Only. It feels like I'm missing something really obvious and simple.
I have this following test which is failing:
[TestFixture]
public class ParentChildTests
{
[...
Hi,
I have an objectcontext and code-only definition of my model. How do i use the EntityDataSource to connect?
Is there a way to define a connectionstring to my ObjectContext class?
...
I have the following:
Product POCO
ProductConfiguration class for EF code only (CTP3)
Product table in database
ProductCrossSell table in database
My Product and ProductConfiguration class looks like:
public class Product
{
public virtual Guid Id { get; set; }
public virtual string Name { get; set; }
public virtual IColl...
Hi,
I can't figure out how to solve the following problem.
What i need it a relationship from one base class to another, so that every derived class has a relationship with the same table, called 'Item' in my example.
Since this is just an example it doesn't reflect my program. In the real program the relationship with class Item is in...
I have recently begun to use the EF v4 Code Only library for some projects I am working on. However, I have run into a bit of a snag. I can't seem to figure out the proper format for the connection string. I have used the following code to build the connection string:
string connectionString = new EntityConnectionStringBuilder
{
Pro...
With EF Code First CTP 4 I've created a simple project. This project consists of 2 classes, one inherited from other.
I wish to store the data in separate tables, but the default of EF 4 is to map/store these two entities in the same table.
With .ToTable(), I can change this behavior, but with this I have a side effect: when I persist ...