DBML Fixup Preview

Back in February I blogged about DBML Fixup—a tool whose goal was to sync LINQ to SQL models with their respective database schemas from within the Visual Studio environment, as well as to handle running various fixup tasks on models. Now it’s six months later, and I have a much clearer vision of what the tool is meant to be as well as a firmer command on VSX. The following screencast is a preview of the features of DBML Fixup.

 

 

Here are some previous posts which (briefly) describe the domain:

http://blogs.rev-net.com/ddewinter/2008/02/16/the-linq-to-sql-model/

http://blogs.rev-net.com/ddewinter/2008/02/16/linq-to-sql-and-database-schema-sync/

 

Any ideas about directions for the tool? Or maybe something that wasn’t covered in the screencast? I’d love to hear your ideas.

11 Responses to “DBML Fixup Preview”

  1. RyanTheRobot Says:

    very good screen cast. I like the simplicity of the tool, but I’m curious as to how often you find yourself actually needing to “fixup” DBML. Is this a tedious task that you find yourself actually doing in a production environment?

  2. David DeWinter Says:

    I would contend that database schemas are constantly under revision, especially in iterative development cycles. Having to sync the model with the database schema manually does become tedious, even if it’s just the first time.

    Personally, I have encountered this with the Entity Framework tools because of a bug that prevented us from using the “Sync Model with Database” feature. And let me tell you–it was very painful.

    But don’t take my word for it: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=260723

  3. Josh Says:

    Excellent cast, Dave. You mentioned how regenerated manually causes you to lose any customizations you may have made. Indeed, this is true. Will your tool be able to keep return types synchronized?

    In the past to help optimize my data layer, I have selected additional information in stored procedures and had to perform manual operations on the result sets. I found myself returning the same information in several stored procedures, so I created a Class in the designer and mapped the generated methods’ return types to that Class. I don’t know how common of a practice this may be, but I’m curious as to whether your tool could keep that information synchronized as well.

    @RyanTheRobot: I don’t know that I’ve ever encountered a time where I did not have to “fixup” a LINQ to SQL model. While I may not use LINQ to SQL that often, I believe this tool will be invaluable whenever I do choose it as a persistence strategy.

  4. Josh Says:

    *regenerating manually

  5. Jason Says:

    Great screen cast, great tool! I think the Enum mapping is fantastic feature.

    I do have a question for you. There is a pretty nasty bug in the DBML designer when setting some connection string settings. Basically what happens is everytime you make any changes to the DBML the option that sets whether you store the connection string in the App.Config or not keeps getting set to True! Since we use it alot at work we have to explain to every new developer how to work around this bug… which basically is change the setting back to False everytime you open the DBML file. Do you think your Fixup can solve this issue? Message me sometime if you need more details.

    If you want a new topic for a screencast, how about ‘how to map your own custom entities to stored procedures using LinqToSql’ instead of the autogenerated table ones! I have yet to figure it out and thats why I have been playing with code generation these days.

  6. David DeWinter Says:

    Hi Josh,

    The tool has been designed to account for your scenario of updating sproc return types as well as the rest of the model, even in cases where your return type was mapped to an entity type which represents a table but must now be mapped to something new because of changes to the sproc.

  7. David DeWinter Says:

    Hi Jason,

    Thanks for the comments. I have tried to reproduce the bug that you described, but I cannot, nor can I find anything on Connect about it. Maybe we can talk later about it.

    If you are interested in the minutiae of stored procedures in LINQ to SQL then check out ScottGu’s post here. Look for the section called “Mapping the Return Type of SPROC Methods to Data Model Classes.”

    HTH,
    David

  8. Jason Says:

    Out of curiosity, are you using Linq to XSD in your tool? I found this: link http://www.adverseconditionals.com/2008/05/scripting-changes-to-linq-to-sql-dbml.html
    It gives an example on how to change the casing on column names and stuff in code. Pretty neat.

  9. David DeWinter Says:

    Thanks for the link, Jason. LINQ to XSD is a great idea, but I’m wary of using alpha products because they might not RTM.

    LINQ to XML has suited my needs just fine.

  10. Dhaval Says:

    Respected Sir,

    First of all, thanks for such valuable forum, posted by you. It is a great help for me. But, when i open my project, there i don’t see any “Run Fixup Task” with right click & “DBML Fixup Preference” under Tools menu. So, guide me, how can i get all those options? Is it, i need to install any third party component?

    I will be waiting for your update.

    Thanks for your cooperation.

    Regards

  11. David DeWinter Says:

    Hi Dhaval,

    You would get those options by installing my DBML Fixup plugin for Visual Studio 2008. But it has not yet been released to the public.

    David

Leave a Reply