Search Results

Search found 88041 results on 3522 pages for 'ef4 code only'.

Page 17/3522 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • What is the best way to add attributes to auto-generated entities (using VS2010 and EF4)

    - by Dani
    ASP.NET MVC2 has strong support for using attributes on entities (validation, and extending Html helper class and more). If I generated my Model from the Database using VS2010 EF4 Entity Data Model (edmx and it's cs class), And I want to add attributes on some of the entities. what would be the best practice ? how should I cope with updating the model (adding more fields / tables to the database and merging them into the edmx) - will it keep my attributes or generate a new cs file erasing everything ? (Manual changes to this file may cause unexpected behavior in your application.) (Manual changes to this file will be overwritten if the code is regenerated.)

    Read the article

  • How do I verify my EF4 Code-Only mappings?

    - by Tomas Lycken
    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 EF4 Code-Only mappings?

    Read the article

  • What is the way to understand someone else's giant uncommented spaghetti code? [closed]

    - by Anisha Kaul
    Possible Duplicate: I’ve inherited 200K lines of spaghetti code — what now? I have been recently handled a giant multithreaded program with no comments and have been asked to understand what it does, and then to improve it (if possible). Are there some techniques which should be followed when we need to understand someone else's code? OR do we straightaway start from the first function call and go on tracking next function calls? C++ (with multi-threading) on Linux

    Read the article

  • Calling a native callback from managed .NET code (when loading the managed code using COM)

    - by evilfred
    Hi, I am really confused by the multitude of misinformation about native / managed interop. I have a C++ exe which is NOT built using CLR stuff (it is not Managed C++ or C++/CLI and never will be). I would like to access some code I have in a C# assembly. I can access the C# assembly using COM. However, when my C# code detects an event I would like it to call back into my C++ code. The C++ function pointer to call back into will be provided at runtime. Note that the C++ function pointer is a function found in the exe's execution environment. I don't want the managed code to try and load up some DLL to call a function (there is no DLL). How do I pass this C++ function pointer to my C# code through .NET and have my C# code successfully call it? Thanks!

    Read the article

  • Debug .Net Framework's source code only shows disassembly in Visual Studio 2010

    - by jdecuyper
    Hi! I'm trying to debug .Net Framework's source code using Visual Studio 2010 Professional. I followed the steps described in Raj Kaimal's post but I must be doing something wrong since the only code I'm getting to see is the disassembly code: As you can see in the image, the Go to Source Code and the Load Symbols options are disabled. Nevertheless, symbols are downloaded from Microsoft's server since I can see them inside the local cache directory. The code I'm debugging goes as follow: var wr = WebRequest.Create("http://www.google.com"); Console.WriteLine("Web request created"); var req = wr.GetRequestStream(); Console.Read(); When I hit F11 to step into the first line of code, a window pops us looking for the "WebRequst.cs" file inside "f:\dd\ndp\fx\src\Net\System\Net\WebRequest.cs" which does not exists on my machine. What am I missing? Thanks a lot for your help.

    Read the article

  • Formatting code in research reports

    - by RoseOfJericho
    I am currently writing a formal research report, and I'll be including JavaScript and PHP code. None of the sections of code will be more than 25 lines (so they're mere snippets). There will be approx. half a dozen snippets, each of which will have a couple of paragraphs explaining what is happening in the code and a discussion on its pros/cons. Is there an accepted way of displaying code in research reports? I'm thinking in terms of font, spacing, whether the code should be displayed inside the document or in an appendix, and related details. I have no contact with the body the report will be submitted to, and they have no published guidelines on how to format code.

    Read the article

  • Refactor/rewrite code or continue?

    - by Dan
    I just completed a complex piece of code. It works to spec, it meets performance requirements etc etc but I feel a bit anxious about it and am considering rewriting and/or refactoring it. Should I do this (spending time that could otherwise be spent on features that users will actually notice)? The reasons I feel anxious about the code are: The class hierarchy is complex and not obvious Some classes don't have a well defined purpose (they do a number of unrelated things) Some classes use others internals (they're declared as friend classes) to bypass the layers of abstraction for performance, but I feel they break encapsulation by doing this Some classes leak implementation details (eg, I changed a map to a hash map earlier and found myself having to modify code in other source files to make the change work) My memory management/pooling system is kinda clunky and less-than transparent They look like excellent reasons to refactor and clean code, aiding future maintenance and extension, but could be quite time consuming. Also, I'll never be perfectly happy with any code I write anyway... So, what does stackoverflow think? Clean code or work on features?

    Read the article

  • Unit testing a SQL code generator

    - by Tom H.
    The team I'm on is currently writing code in TSQL to generate TSQL code that will be saved as scripts and later run. We're having a little difficulty in separating our unit tests between testing the code generator parts and testing the actual code that they generate. I've read through another similar question, but I was hoping to get some specific examples of what kind of unit test cases we might have. As an example, let's say that I have a bit of code that simply generates a DROP statement for a view, given the view schema and name. Do I just test that the generated code matches some expected outcome using string comparisons and then in a later integration or system test make sure that the drop actually drops the view if it exists, does nothing if the view doesn't exist, or raises an error if the view is one that we are marking as not allowing a drop? Thanks for any advice!

    Read the article

  • Code Review "ToDo" Follow Up Items

    - by Blake Blackwell
    I am trying to institute code reviews at my company, and recently we had our first code review meeting. During the meeting, several positive suggestions were made and I added TODO comments in my code for following up. After reading suggestions on here on best practices for code reviews, I would like to follow up on all the items I corrected at the start of the next meeting. Is there a way to add a similar type of comment to the code such as FOLLOWUP so that I can quickly highlight through those code segments in the next meeting?

    Read the article

  • PPV Code Review - Is it good idea?

    - by user93422
    I believe in (solo) code reviews a lot. But I am in a one-developer-shop now. I would like to have my code reviewed, and willing to pay money for it. Question: Is there a place where I can have my code reviewed for money? Note: I understand that most of us are willing to review some one else code for free, but there is a limit to how much code one (e.g. I) is willing to review for free before getting bored. Question: Is it good idea to pay 3d party to do my code-reviews?

    Read the article

  • Embeding EasyVideoPlayer Code into Wordpress Theme - Video not showing

    - by bbacarat
    I'm attempting to place some embed code into a Premium WordPress Theme. NOTE: I'm not great when it comes to php. The embed code is produced by a video player called EasyVideoPlayer. (Basically it allows me to use Amazon S3 and gives me feedback on when people stop watching the video.) This is the embed code I have: _evpInit('ZXh0cmEtbW9uZXktZnJvbS1ob21lLTEubW92'); I've opened the index.php wordpress file and placed this video embed code in between the that represents the area of the website I want it to show up. However the video is not showing. If we place both the theme and video player aside, would you expect the php code to accept what I've done or is this not the way to go about adding this embed code? NOTE:I've contacted both the Wordpress Premium Theme support at Woothemes.com and the video players support for EasyVideoPlayer.com However both tend to stop at the point that another paid product is involved! Grrreat. website is www.extramoneyfromhome.co.uk

    Read the article

  • Putting a dollar value on code quality

    - by Chris Nelson
    As noted in another thread, "In most businesses, code quality is defined in dollars." So my company has an opportunity to acquire a large-ish C code base. Obviously, if the code quality is good, the code base is worth more than if it's poor. That is, if we can readily read, understand, and update the code, it's worth more to us than if it's a spaghetti-coded mess. Without being able to see the code ahead of time, we'd like to set some objective measure as an acceptance criteria like "If the XXX measure is below the price will be discounted YY%." What criteria can we or should we measure and what tool can we use to measure it?

    Read the article

  • Searching for empty methods

    - by Brian McCord
    I am currently working on a security audit/code review of our system. This requires me to check all pages in the system and make sure that the code behind contains two methods that are used to check security. Sometimes the code in these methods get commented out to make testing easier. So, my question is does anyone know an easy way to search code, make sure the methods are present, and to determine which ones have no code or have all the code commented out. It would make my job much easier if I can get a list instead of having to look at every file... I'm sure I could write this myself, but I thought someone may know of something that already exists. Thanks!

    Read the article

  • Working with Legacy code #1 : Draw up a plan.

    - by andrewstopford
    Blackfield applications are a minefield, reaking of smells and awash with technical debt. The codebase is a living hell. Your first plan of attack is a plan. Your boss (be that you, your manager, your client or whoever) needs to understand what you are trying to achieve and in what time. Your team needs to know what the plan of attack will be and where. Start with the greatest pain points, what are the biggest areas of technical debt, what takes the most time to work with\change and where are the areas with the higest number of defects. Work out what classes\functions are mud balls and where all the hard dependencies are. In working out the pain points you will begin to understand structure (or lack of) and where the fundmentals are. If know one in the team knows an area then profile it, understand what lengths the code is going to.  When your done drawing up the list then work out what the common problems are, is the code hard tied to the database, file system or some other hard dependency. Is the code repeating it's self in structure\form over and over etc. From the list work out what are the areas with the biggest number of problems and make those your starting point. Now you have a plan of what needs to change and where then you can work out how it fits into your development plan. Manage your plan, put it into a defect tracker, work item tracker or use notepad or excel etc. Mark off the items on your plan as and when you have attacked them, if you find more items then get them on your plan, keep the movement going and slowly the codebase will become better and better.

    Read the article

  • The Agile Engineering Rules of Test Code

    - by Malcolm Anderson
    Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Lots of test code gets written, a lot of it is waste, some of it is well engineered waste.Companies hire Agile Engineering Coaches because agile engineering is easy to do wrong.Very easy.So here's a quick tool you can use for self coaching.It's what I call, "The Agile Engineering Rules of Test Code" and it's going to act as a sort of table of contents for some future posts.The Agile Engineering Rules of Test Code Malcolm Anderson   Test code is not throw away code Test code is production code   8 questions to determine the quality of your test code Does the test code have appropriate comments?Is the test code executed as part of the build?Every Time?Is the test code getting refactored?Does everyone use the same test code?Can the test code be described as “Well Maintained”?Can a bright six year old tell you why any particular test failed?Are the tests independent and infinitely repeatable?

    Read the article

  • Code review “on a napkin” — could it be useful?

    - by gaRex
    Preconditions Team uses DVCS IDE supports comments parsing (like TODO and etc.) Tools like CodeCollaborator are expensive for budget Tools like gerrit are too complex for install or not usable Workflow Author publishes somewhere on central repo feature branch Reviewer fetch it and start review In case of some question/issue reviewer create comment with special label, like "BLA". Such label MUST not be in production code -- only on review stage: $somevar = 123; // BLA Why do echo this here? echo $somevar; When reviewer finish post comments -- it just commits with stupid message "comments" and pushes back Author pulls feature branch back and answer comments in similar way or improve code and push it back When "BLA" comments have gone we can think, that review has successfully finished. Author interactively rebases feature branch, stashes it to remove those "comment" commits and now is ready to merge feature to develop or make any action that usualy could be after successful internal review IDE support I know, that custom comment tags are possible in eclipse & netbeans. Sure it also should be in blablaStorm family. So my specific questions are Do you think this methodology is viable? Do you know something similar? What can be improved in it? ps: migrated from http://stackoverflow.com/questions/12692695/code-review-on-a-napkin-could-it-be-useful

    Read the article

  • Recent resources on Entity Framework 4

    - by Eric Nelson
    I just posted on the bits you need to install to explore all the features of Entity Framework 4 with the Visual Studio 2010 RC. I’ve also had a quick look (March 12th 2010) to see what new resources are out there on EF4. They appear a little thin on the ground – but there are some gems. The following all caught my attention: Julie Lerman has published 2 How-to-videos on EF4 on pluralsight.com. You need to create a free guest pass to watch them. Getting Started with Entity Framework 4.0 – Session given at Cairo CodeCamp 2010 . This includes ppt and demos. Entity Framework 4 providers – read through the comments What’s new with Entity Framework in Visual Studio 2010 RC Extending the design surface of EF4 using the Extension Starter Kit Persistence Ignorance and EF4 on geekSpeak on channel 9 (poor audio IMHO – I gave up) First of a series of posts on EF4 How to stop your dba having a heart attack with EF4 from Simon Sabin in the UK. This includes ppt and demos. And the biggy. You no longer have to depend on SQL Profiler to keep an eye on the generated SQL. There is now a commercial profiler for Entity Framework.  I am yet to try it – but I listened to a .NET rocks podcast which made it sound great. It is “hidden” in a session on DSLs in Boo –> Oren Eini on creating DSLs in Boo. This is a much richer experience than you would get from SQL Profiler – matching the SQL to the .NET code. And finally a momentous #fail to … drum roll… the Visual Studio 2010 and .NET Framework 4 Training Kit Feb release. This just contains one ppt on EF4 – and it is not even a good one. Real shame. P.S. I will update the 101 EF4 Resources with the above … but post devweek in case I find some more goodies. Related Links 101 EF4 Resources

    Read the article

  • Is committing/checking in code everyday a good practice?

    - by ArtB
    I've been reading Martin Fowler's note on Continuous Integration and he lists as a must "Everyone Commits To the Mainline Every Day". I do not like to commit code unless the section I'm working on is complete and that in practice I commit my code every three days: one day to investigate/reproduce the task and make some preliminary changes, a second day to complete the changes, and a third day to write the tests and clean it up^ for submission. I would not feel comfortable submitting the code sooner. Now, I pull changes from the repository and integrate them locally usually twice a day, but I do not commit that often unless I can carve out a smaller piece of work. Question: is committing everyday such a good practice that I should change my workflow to accomodate it, or it is not that advisable? Edit: I guess I should have clarified that I meant "commit" in the CVS meaning of it (aka "push") since that is likely what Fowler would have meant in 2006 when he wrote this. ^ The order is more arbitrary and depends on the task, my point was to illustrate the time span and activities, not the exact sequence.

    Read the article

  • Web Services and code lists

    - by 0x0me
    Our team heavily discuss the issues how to handle code list in a web service definition. The design goal is to describe a provider API to query a system using various values. Some of them are catalogs resp. code lists. A catalog or code list is a set of key value pairs. There are different systems (at least 3) maintaining possibly different code lists. Each system should implement the provider API, whereas each system might have different code list for the same business entity eg. think of colors. One system know [(1,'red'),(2,'green')] and another one knows [(1,'lightgreen'),(2,'darkgreen'),(3,'red')] etc. The access to the different provider API implementations will be encapsulated by a query service, but there is already one candidate which might use at least one provider API directly. The current options to design the API discussed are: use an abstract code list in the interface definition: the web service interface defines a well known set of code list which are expected to be used for querying and returning data. Each API provider implementation has to mapped the request and response values from those abstract codelist to the system specific one. let the query component handle the code list: the encapsulating query service knows the code list set of each provider API implementation and takes care of mapping the input and output to the system specific code lists of the queried system. do not use code lists in the query definition at all: Just query code lists by a plain string and let the provider API implementation figure out the right value. This might lead to a loose of information and possibly many false positives, due to the fact that the input string could not be canonical mapped to a code list value (eg. green - lightgreen or green - darkgreen or both) What are your experiences resp. solutions to such a problem? Could you give any recommendation?

    Read the article

  • Idiomatic default sort using WCF RIA, EF4, Silverlight?

    - by Duncan Bayne
    I've got two Silverlight 4.0 ComboBoxes; the second displays the children of the entity selected in the first: <ComboBox Name="cmbThings" ItemsSource="{Binding Path=Things,Mode=TwoWay}" DisplayMemberPath="Name" SelectionChanged="CmbThingsSelectionChanged" /> <ComboBox Name="cmbChildThings" ItemsSource="{Binding Path=SelectedThing.ChildThings,Mode=TwoWay}" DisplayMemberPath="Name" /> The code behind the view provides a (simple, hacky) way to databind those ComboBoxes, by loading Entity Framework 4.0 entities through a WCF RIA service: public EntitySet<Thing> Things { get; private set; } public Thing SelectedThing { get; private set; } protected override void OnNavigatedTo(NavigationEventArgs e) { var context = new SortingDomainContext(); context.Load(context.GetThingsQuery()); context.Load(context.GetChildThingsQuery()); Things = context.Things; DataContext = this; } private void CmbThingsSelectionChanged(object sender, SelectionChangedEventArgs e) { SelectedThing = (Thing) cmbThings.SelectedItem; if (PropertyChanged != null) { PropertyChanged.Invoke(this, new PropertyChangedEventArgs("SelectedThing")); } } public event PropertyChangedEventHandler PropertyChanged; What I'd like to do is have both combo boxes sort their contents alphabetically, and I'd like to specify that behaviour in the XAML if at all possible. Could someone please tell me what is the idiomatic way of doing this with the SL4 / EF4 / WCF RIA technology stack?

    Read the article

  • EF4 and multiple abstract levels

    - by Cedric
    I need to use inheritance with EF4 and the TPH model created from DB. I created a new projet to test simples classes. There is my class model: There is my table in SQL SERVER 2008 : VEHICLE ID : int PK Owner : varchar(50) Consumption : float FirstCirculationDate : date Type : varchar(50) Discriminator : varchar(10) I added a condition in my EDMX on the Discriminator field to differentiate the Scooter, Car, Motorbike and Bike entities. MotorizedVehicle and Vehicle are Abstract. But when I compile, this error appears : Error 3032: Problem in mapping fragments starting at lines 78, 85:EntityTypes EF4InheritanceModel.Scooter, EF4InheritanceModel.Motorbike, EF4InheritanceModel.Car, EF4InheritanceModel.Bike are being mapped to the same rows in table Vehicle. Mapping conditions can be used to distinguish the rows that these types are mapped to. Edit : To Ladislav : I try it and error change to become it for all of my entities : Error 3034: Problem in mapping fragments starting at lines 72, 86:An entity is mapped to different rows within the same table. Ensure these two mapping fragments do not map two groups of entities with overlapping keys to two distinct groups of rows. To Henk (with Ladislay suggestion) : There are all of mappings details : What's wrong ? Thanks

    Read the article

  • Maintaining state and data context between requests in ASP.NET + EF4

    - by Nick
    I have a EF4/ASP.NET web application that is structured to use POCOs and generic repositories, based essentially on this excellent article. The application is relatively sophisticated with one page that involves selection and linking of multiple entities to build up a complex user profile. This requires access to multiple entity types (20 or so) and associated repositories across multiple posts. When a repository is first accessed it uses the existing data context if exists, else it creates a new context. The problem is that if the lifetime of the context is only per-request (as suggested in the article) then you have to deal with multiple contexts and the complexity around detaching and attaching entities from contexts. My solution is to share the context between posts by creating a single View Model that includes all required repositories (initialised to share the same context) plus any associated data and store this model in a Session variable, retrieving from Session on subsequent page requests. Therefore maintaining the same context across all posts until the profile is saved. This works fine BUT I am concerned that I don't actually know exactly what is stored in the model session variable or more importantly the size of the Session variable. So two questions I suppose: firstly should I look for a better solution to handle the shared context across posts issue (any suggestions welcome)? And secondly what is actually stored in the Session when it includes a repository plus context? Any help appreciated!

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >