zzz projects Entity Framework 6 EF 6
Home EF Core Articles Knowledge Base Online Examples
  • Home
  • EF Core
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

15 results in tag: validation

Entity Framework Validation

I'm getting ready to start a new project and I've been researching the entity framework. My question is what is the best strategy for validating the entities? Other projects I've worked on have used attributes for most of the validation, but obviously thi...
.net c# entity-framework validation
asked by Micah

Best practice entity validation in ASP.NET MVC & ADO.NET Entity Framework

i am using ASP.NET MVC & ADO.NET Entity Framework in a project. I want to add validation logic to my entities via partial classes. It works similar like shown in the ...NerdDinner.com ASP.NET MVC Application... which is using LINQ2SQL. The main difference...
.net asp.net-mvc entity-framework validation
asked by Alexander

Validate data using DataAnnotations with WPF & Entity Framework?

Is there any way to validate using DataAnnotations in WPF & Entity Framework?
.net data-annotations entity-framework validation wpf
asked by Shimmy

Using DataAnnotations with Entity Framework

I have used the Entity Framework with VS2010 to create a simple person class with properties, firstName, lastName, and email. If I want to attach DataAnnotations like as is done in this ...blog post... I have a small problem because my person class is dy...
asp.net-mvc-2 c# entity-framework validation
asked by dcompiled

Handling required fields in ASP.NET MVC when using Entity Framework

Let me start out by describing my app in a step by step format....First I have my Entity Framework generated model. Within it I have the following entities:...http://www.codetunnel.com/EFEntities.jpg...Now, to implement validation on an entity, I use part...
asp.net-mvc asp.net-mvc-3 c# entity-framework validation
asked by Chev

MVC Entity Framework validation to prevent duplicate records

Hi i'm new to MVC and EF so this may be a really simple question but what is the best way to prevent the user from trying to enter duplicate records?...I have a simple look up table with one column which is the primary key. I'm creating a maintenance scre...
asp.net-mvc entity-framework validation
asked by Jammy

using Metadata with Entity Framework to validate using Data Annotation

I have a entity called Product,this is a part of it's declration:...[EdmEntityTypeAttribute(NamespaceName="NorthwindModel", Name="Product")] [Serializable()] [DataContractAttribute(IsReference=true)] public partial class Product : EntityObject { #regi...
c# c#-4.0 data-annotations entity-framework validation
asked by Arian

@Html.ValidationMessageFor did not work as expected

I have a two model classes which have relationship of one to many....public class CycleType { [Required(ErrorMessage = "Cycle is required.")] public int CycleTypeID { get; set; } [Required(ErrorMessage = "Cycle Type is required.")] [Strin...
asp.net-mvc c# entity-framework validation
asked by Frank Myat Thu

Entity Framework validation with partial updates

I'm using Entity Framework 5.0 with DbContext and POCO entities. There's a simple entity containing 3 properties:...public class Record { public int Id { get; set; } public string Title { get; set; } public bool IsActive { get; set; } } ...The...
entity-framework updates validation
asked by Skog

Allow empty strings for fields marked with PhoneAttribute or UrlAttribute

I'm using CodeFirst Entitty framework 5. I have a class representing a user....public class User { [Key] public int UserId { get; set; } [Url] [DataType(DataType.Url)] [Required(AllowEmptyStrings= true)] public string WebSite { ge...
c# data-annotations ef-code-first entity-framework validation
asked by Nu-hin

Solution for "Validation failed for one or more entities. See 'EntityValidationErrors' property for more details."

I encountered this error, it did not provide any detail as to what the root cause was but I figured out what the problem is. I wanted to share it so that others that encounter it might have success in solving the problem....I had the following class:... ...
asp.net-mvc-5 entity-framework validation
asked by FrankO

C# Entity Framework: Data validation between add to context and saveChanges()

I have a simple scenario using the Entity Framework in C#. I have an Entity Post: ...public class Post { public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } } ...In my PostManager I have these m...
c# entity-framework validation
asked by Andrea Moraglia

Entity Framework GetValidationErrors empty for unique index

I want to check for validation errors before I save the context. I call context.GetValidationErrors(), which is empty, then I call context.SaveChanges() and I get the error for a duplicate row for my unique index....using(var context = new DefaultDbContex...
.net c# entity-framework entity-framework-6 validation
asked by Tony

how to change type validation error messages?

I'm using entity framework code first in an ASP MVC project, and I'd like to change the error message that appears for validation of a numeric type....I have a property like...public decimal Amount1 { get; set; } ...If I enter a non-number in the field, I...
c# data-annotations entity-framework entity-framework-6 validation
asked by Mike

Query database and unsaved changes for validation with Entity Framework 6

I have a data layer using Entity Framework 6 ...Database First.... One of my entities represents a time span - it has a start date and an end date....public class Range { public Guid ID { get; set; } public DateTime StartDate { get; set; } pub...
entity-framework entity-framework-6 validation
asked by xr280xr

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!