Entity Frameworks 4 - Changing the model does not update the T4 self tracking template files - entity-framework-4

I am using self tracking entities and have moved the entity classes to another assembly by using 'Add as link' to point to the TT file as mentioned here. Now though, when I update the model (for instance change a property name) the template is not automatically run and so the entity class does not get updated.
I can of course manually run the template to get the updates, but it would be easier if it ran automatically in the way it did before I moved the classes. Is there any way to achieve this?
Darren.

I've not done this but I suspect the following is possible. Mark the model with a custom tool (see under properties of the file in solution explorer). Then create a small program (see here for an example) that will execute a the TT's run custom tool.

I have not run into this issue. Usually when i save the model or build the project which contains my edmx file, the code files for my entities are updated. can you share your project with me through direct email. I wouldn't mind trouble shooting the problem and then following up with team if we cant get it to work.

Related

Entities cannot be found after update edmx file

For the project I am working on, we have updated the database with two extra datatables that I now would like to add to the edmx file, but this gives an unwanted result.
What I do is open the edmx file, open the model Browser and run Update form database. In the wizard here I choose the two tables I want to add under the add tab and click finish.
The tables show up in the diagram view and in the Model browser under Model.Store-Tables/Views (and under Entity Types and EntityContainer). So far so good.
When I then save the changes to the edmx, all other existing entities,as well as the complete content of the Model.Context.tt file are deleted. The result being that the context entity and all underlying entities no longer can be found.
I do not understand why this is happening, and I don't know how to fix this and I am now stuck in the development of the project. i am using VS2015 and Entity Framework 6. I have spend most of the day to find a solution, but have not been able to do so. None of the "Entity can't be found" solutions around fixed my problem. I hope therefor that some smart minds here can help.
Thans!

ADO.NET Entity Data Model Wizard - Model Class file not getting created

Used the "ADO.NET Entity Data Model" Wizard.
Gave the corresponding connectivity and once the wizard completes, the .edmx file opens with the diagram containing my table structure.
But the Model Class file is not created.
How to overcome this error?
I even build the solution, also checked by using "Show All Files".Nothing works out.(using VS2010 SP1, EF6)
Deleted the project and tried again and then was able to find the model file.
This is not the correct answer but as it solved the issue, this might be an answer for this issue.

Jira: Any way to define default issues to add to new project?

Is anyone aware of a way to define a set of default issues, which can then be attached to a project type definition so that each time a project of this type is created, it comes with these issues?
All of our projects have issues like 'create wireframes','set up local environment' etc. and I'm looking for a quick way to automate this part of project setup.
I have full admin access and I can't see anything in the issue or project setup that does this.
Can't you just create a set of issues in an empty project and export them?
You can use that set and import it into your new project to start with.

TFS - Permission for specific project

This is the extension of the following Stack Overflow question
Scenario:
Visual Studio Solution has projects A, B & C.
Project A is core library used by B & C.
Remote employee has permission to access only project C (which needs project A).
Question:
How can remote employee build and test project C which references project A, while remote employee has permission to access only project C.
Is it necessary to share project A with remote employee or is there any way around.
You can simply remove Project A from the solution. Obviously, the other projects would still need the relevant dlls.
If there is very sensitive information in project A then I have the following suggestion (of course this will depend on your architecture):
Create a public interface for project A, put this in Project D or something.
Make project A use this, then create a mock for the Project A interface and provide this project instead.
This would give all the dependencies necessary, and mean that you don't have to provide the dependant dlls. It is also good practice for unit testing.
In order to solve this, you need to
Move project C out of the solution into a solution of its own.
Change the project reference from C to A to a binary reference so that C references the compiled output of A. In order to do this, place A.dll in a directory under the newly created C-solution. Also add A.dll to source control so that the remote employee can retrieve the solution and A.dll from source control.
If you make changes to A that are required in project C, you need to check out A.dll, substitute it by the new version and check it in again.
Of course this means that the effort is higher if you want to propagate changes made to project A to the newly created C-solution. But it separates the environments cleanly from one another.
This approach also works if you want to follow the excellent suggestion of #pm_2 about extracting the relevant interface of A and provide only a mock version to the remote employee. In this case, you place the interface dll and the mock version to source control.

Moving entities between configurations in Xcode Data Model Editor

I'm currently working on an app which, will hopefully, use Core Data to store/retrieve data from 2 sqlite files (At the moment it just uses 1). I realise to do this I have to create another configuration in the Core Data Model Editor of Xcode which I have done. Now, I am trying to move entities from my current configuration into the new one but I cant find a way of doing it. I'm using Xcode version 4.5.1.
Am i doing this right? How do you move move entities between configurations?
Any help is much appreciated :)
Select one configuration in the left pane of the model editor and then drag'n'drop one or more of its entities from the right pane to another configuration in the left pane. This will copy the entity, so you still need to delete it from the original configuration.
This worked for me in Xcode 7.2.1:
Display the source model, select the source entity, select Edit menu/copy.
Display the target model. In the Entities pane Add Entity (+) for new entity.
Select the new entity and click Edit menu/paste.
I know of two approaches depending on how many entities you need to transfer.
If you want most or all of the entities to be copied, you can copy and rename your existing xcdatamodel in the Finder, then add the new file to the project. I've done this as a test, but since I'm only working with a single versioned model, I haven't gone through to production with a model entered this way, so I don't know if there are any downsides.
If you only have a few entities to transfer, simply select the entity in one model, copy it (command-c), then select the other model and paste it (command-v). This only works for one entity at a time and you need to do some clean-up afterwards, but it's still better than manually re-entering all of the properties. After copying, update the following in the new model, which don't transfer over cleanly:
Relationship targets and inverses.
Relationship delete rules.
Parent entities.

Resources