All posts by Julie

Vermont.NET User Group: Tomorrow night switch to EF4 instead of ASP.NET 4.0

The speaker originally scheduled is ill and can’t make it tomorrow night (would have been a 4 hour drive to Burlington). So rather than cancel the meeting, I will do an Entity Framework 4.0 Intro presentation. I’ll be happy to address more advanced questions once the intro is complete.

We are grateful to have a pizza/soda sponsor, FIT Solutions (www.fitsolutions.us).

Please register at vtdotnet.eventbrite.com so we order enough pizza and you are registered for the raffles. Lots of swag goodies!

When: Monday June 14th, 6-8:30pm

Where: GE Healthcare, 40 IDX Drive, South Burlington, VT

Vermont IT Jobs: C# Developer in Burlington

Senior C# Engineer Qualifications:

  • 5+ years of programming experience
  • Strong C# development skills
  • Thorough grounding in Object-Oriented design principles and design patterns
  • Bachelor’s Degree in Computer Science or related field
  • Strong message-oriented development skills (JMS, MSMQ, TCP/IP, Web Services, etc.)
  • Agile development background (understanding of methodology, terms, and process)
  • Demonstrated teamwork and flexibility in previous work assignments
  • Experience working closely with QA, Documentation, and Technical Support
  • Strong communication skills with technical and non-technical personnel
  • Demonstrated analytic and problem solving skills
  • Candidates must be organized, detail oriented, and professional

Kathie Cheney, PHR
Technical Connection, Inc.
P.O. Box 1402
Burlington, VT 05402
Tel: 802-658-8324
Fax: 802-658-0175
email: vermontjobs@vttechjobs.com

My Inbox: How to save changes coming from disconnected POCOs

I receive a lot of random emails from developers with Entity Framework questions. (This is not a request for more! :)) If I’m too busy to even look or if it’s something I can’t answer off the top of my head, I swallow my pride and ask the person to try the MSDN forums. If the email is from a complete stranger and has gobs and gobs of code that email will surely get a "please try MSDN forums" reply. 

But sometimes I’m not in my usual state of “too much to do” panic and get a question that is short & sweet and I can answer it effortlessly. This is one of those types of questions.

Question from Arda Çetinkaya

Hi;

I am contacting with you with a suggestion of my friend who is one of the best MVPs of Turkey…So I have a small question if you can answer it I will be very happy…

What I am trying to do is updating a poco entity with entity framework…My poco entity is not in context,so I am attaching it first…But no change is done…How can I update my poco entities…If you have any resource for it,I really need it…

Reply

You would have the same problem with EntityObjects as with POCOs. If you are using EF4, then you have a lot of options that you did n ot have in EF1.

Assuming it’s EF4, the simplest is to use the new ObjectContext.ObjectStateManager.ChangeState (might be ChangeObjectState) method. But that means you need to know what the state should be …added, updated or deleted.

That’s just one way and might be just what you need or might not fit your scenario.

If you search for changestate/changeobjectstate and Entity Framework on the web you should find lots of blog posts and articles on this.

Good Luck

julie

Follow-up from Arda 20 minutes later

Thanks a lot for your reply…It helped me to clear it out…

With the following code change, I got it…Thanks a lot…You saved my life (:

 public static void UpdateConfigurationSetting(ConfigurationSetting configurationSettingToUpdate)
{
  try
  {
    using (DBEntities entities = new DBEntities ())
    {
      entities.ConfigurationSetting.Attach(configurationSettingToUpdate);
      ObjectStateEntry entry = entities.ObjectStateManager
.GetObjectStateEntry(configurationSettingToUpdate); entry.ObjectStateManager
.ChangeObjectState(configurationSettingToUpdate, System.Data.EntityState.Modified); entities.SaveChanges(); } } }

June in May?

The Lupine, Phlox & Rhodendron are already in full bloom. Usually that happens while I’m away at TechEd in mid-June so this is very early (lucky me I get to enjoy it this year). Considering that it was only a month ago that we had a spring snow storm, I would have expected things to be late, not early! (Compare the shrubs along the fence in the first picture here with what they looked like in the 2nd photo of the snow storm pics.)

Unfortunately, even though the lupine are early, the bumper crop of dandelions is still hanging in there so the field doesn’t look as nice as it could thanks to all of the dirty white dandelion fluff.

 May 30 1

may 30 2

May 3031

may 30 4

 

IMG_3433

Programming Entity Framework, 2nd Edition (EF4) Table of Contents

We are closing in on finalizing the 2nd edition of Programming Entity Framework! Although the rough draft chapters are already available through Safari’s Rough Cuts program (here: http://oreilly.com/catalog/9780596807252) I have been editing and reshaping the content since those chapters were published. You can get the final print edition (August 15th or perhaps a bit earlier) at O’Reilly or pre-order it here on Amazon.com (here) (and elsewhere of course!)

I believe that the book will end up being about the same length (app. 800 pages) as the first edition.

Here is the final chapter list:

Chapter 1, “Introducing the ADO.NET Entity Framework”

Chapter 2, “Exploring the Entity Data Model”

Chapter 3, “Querying Entity Data Models”

Chapter 4, “Exploring LINQ to Entities in Greater Depth”

Chapter 5, “Exploring Entity SQL in Greater Depth”

Chapter 6, “Modifying Entities and Saving Changes”

Chapter 7, “Using Stored Procedures with the EDM”

Chapter 8, “Implementing a More Real-World Model”

Chapter 9, “Data Binding with Windows Forms and WPF Applications”

Chapter 10, “Working with Object Services”

Chapter 11, “Customizing Entities”

Chapter 12, “Data Binding with RAD ASP.NET Applications”

Chapter 13, “Creating and Using POCO Entities”

Chapter 14, “Customizing Entity Data Models Using the EDM Designer”

Chapter 15: “Defining EDM Mappings That Are Not Supported by the Designer”

Chapter 16, “Working with Stored Procedures Without Function Mapping or Function Imports*

Chapter 17, “Using EntityObjects in WCF Services”

Chapter 18, “Using POCOs and Self-Tracking Entities in WCF Services”

Chapter 19, “Working with Relationships and Associations”

Chapter 20, “Managing Connections, Transactions, Performance, and More for Real-World Applications”

Chapter 21, “Manipulating Entities with ObjectStateManager and MetadataWorkspace”

Chapter 22, “Handling Exceptions”

Chapter 23, “Planning for Concurrency Problems”

Chapter 24, “Building Persistent Ignorant, Testable Applications”

Chapter 25, “Domain Centric Modeling ”

Chapter 26, “Using Entities in n-Tier Client-Side Applications”

Chapter 27, “Building n-Tier Web Applications”

Appendix A, “Entity Framework Assemblies and Namespaces”

Appendix B, “Data-Binding with Complex Types”

Appendix C, “Additional Details about Entity Data Model Metadata”

* Need to come up with a better title for Ch 16. It’s all the stuff you can do with sprocs & (views too) that aren’t supported by the designer.

Mapping Help in the EDM Designer

The mapping details window that displays the mappings between an entity and database table(s) is pretty straightforward.

When you join two related tables in a Table Per Hierarchy inheritance things can get a little confusing when it comes to the mappings for inherited properties.

But did you know that the Mapping Details window uses the Properties window to help?

Here are two entities in a TPH hierarchy.

mappingA

Customer inherits Contact. Customer maps to a Customers table which uses “ContactID” as its primary key. It entity no longer has its own ContactID property though because it inherits ContactID from the Contact entity.

Here is the Mapping Details window for the Customer entity.

 mappingB

The column on the left displays the database columns while those on the right show which entity property the column is mapped to.

Before I created the hierarchy, Customers.ContactID mapped to a ContactID property in the Customer entity. But that’s gone now. Might be a bit confusing because it says ContactID there still.

If you have the properties window open though it will show you the properties of whatever column or property you have selected.

Click the ContactID in the Value/Property table and you can see that it’s mapping to the Contact.ContactID property, as it should since Customer.ContactID no longer exists.

 mappingD

You can also see properties of selected database columns which are read In the store schema. Here, I have selected the ContactID column on the left. The property window shows that it is from the ContactID column defined in the BreakAwayModel.Store.Customers which is the schema representation of what’s in the database.

mappingC

And now for the footnote. I just discovered this today in VS2010 but before I blogged about this great new feature (really it can be helpful if you need it) I opened up VS2008 and discovered its been there all along. 🙂 I just happened to have the Properties window open today when clicking around in the mapping and noticed something changing.

Vermont IT Jobs: .NET Developer in Downtown Burlington

Applications Engineer

Aurora North Software, Inc.

Burlington-based software development & consulting company offers an opportunity to rapidly advance your skillset using the latest MS technologies to develop and implement core systems at some of the country’s most prestigious law firms.  Projects include product integration, workflow processing, business intelligence, and SharePoint development.

Requires a minimum 2-5 years experience with full development life cycle, .NET development experience, familiarity with C# and VB.net, and solid abilities with MS development tools.    Preference given to applicants experienced in building enterprise SharePoint applications. 

If you have a passion for perpetual improvement, enjoy a diversity of projects and autonomy, and play well with others, we’d love to hear from you.  Please send your resume and cover letter to: careers@auroranorthsoftware.com

This position is on-site and there is free on-site parking.

Vermont IT Jobs: Sr. Security Analyst in Montpelier

Senior Security Analyst

Summary

This position is responsible for advancing the Information Systems program within the company by assisting the Chief Information Security Officer (CISO) to plan, develop, and monitor administrative, physical, and technical safeguards for the company’s Information Assets.

Key Responsibilities

  • Under Direction of CISO, establish  and maintain company-wide information security policies, standards and procedures
  • Manage the Information Security Program Office (ISPO) with oversight of all security initiatives for cost, time and quality
  • Coach and mentor directors, managers and associates on specific technologies that allow secure business growth
  • Evaluate, recommend, select, and manage the implementation of proven industry accepted solutions to enhance the company’s core security capabilities in the areas of infrastructure, access management, networking, databases, servers, etc.
  • Lead and direct in cooperation with the Business Continuity Planning Department, the planning and implementation of the company’s IT Business Continuity and IT Disaster Recovery efforts to ensure that the required technical service facilities can be resumed within required, and agreed, business timescales
  • Execute all stages of the problem determination and resolution process as it pertains to security incidents, breaches and problems.
  • Lead and direct the activities necessary to design, develop and implement a company-wide Security Awareness program.
  • Create information security risk assessment methodology and performs information risk assessments using the methodology.  Lead internal information security risk assessments to ensure proper resolution to security, risk, or compliance issues
  • Maintain expertise in the area of security, including trends, strategies, and products to ensure that the company’s information assets continue to be protected at the levels required by the business

Qualifications and Experience

  • Bachelor’s Degree in IT or Information Security
  • Knowledge of Information Security standards and frameworks
  • 3-5 years of direct Information Security experience ideally in regards to Risk Assessment, Metrics & Reporting, Education and Awareness and Incident Response
  • Excellent writing skills for drafting of policies, procedures and analytical summaries
  • Strong Microsoft Office skills
  • Excellent verbal communication skills, strong analytical, teamwork and organizational skills
  • Results driven individual who can handle multiple complex assignments, set and adjust priorities, rapidly engage new assignments based on criticality, all in a fast paced and often stressful environment, and with a timely and professional manner
  • Energetic and self motivated; enthusiastic and positive attitude.
  • Ability to think strategically, multi-task, and work effectively and efficiently with minimum direction in a team environment
  • Hold at least one professional certification, (e.g. CISA, CISSP) or willingness to obtain one.

Contact
Kim Coffin
FIT Solutions, LLC
"Providing IT Resources that FIT Your Business"
413-214-2552 (cell)
413-363-0204 (fax)
kcoffin@fitsolutions.us
www.fitsolutions.us

Hard Core EF4 Full-Day Workshop, June 24th, Stockholm

 The date (Thursday, June 24th), the city (Stockholm) and the abstract are firm.

REGISTER HERE: http://www.dotnet4ever.se/ or directly at http://www.informator.se/utbildningar/seminarier/seminarier/hard-core-entity-framework-40.aspx

Now I have to wait for the person organizing this workshop on my behalf to provide registration details. This will be a public workshop.

I will update this blog post, write a new one and also tweet (twitter.com/julielerman) the details as soon as I have them. (They’re here now)

Hard Core EF4

Full Day of Advanced Entity Framework 4 Workshop with Julie Lerman

You’ve been working with Entity Framework 3.5 or maybe even Entity Framework 4, but are ready to take your EF4 code further. You’ve got nagging questions and wish you could just spend a day with an Entity Framework guru!

Now’s your chance! On June 24th Julie Lerman will be conducting a full day Advanced Entity Framework 4 workshop in Stockholm.

The day will focus on the benefits of EF4’s new POCO support.

You’ll learn the different ways that you can enable POCO support in Entity Framework

You’ll then see how to take advantage of the POCO support.

  • Customizing the code generation templates.
  • Using POCOS in WCF services without pulling your hair out to deal with change tracking
  • Building smarter architectures with repositories, Unit of Work
  • Unit testing with fake contexts and fake data without hitting the database.

½ day of demos + ½ day of Q&A with the pro= 
1 day of Hard Core Entity Framework 4.

REGISTER at http://www.dotnet4ever.se

or directly on informator’s website at:
http://www.informator.se/utbildningar/seminarier/seminarier/hard-core-entity-framework-40.aspx