26

Re: in a Visual Studio 2013

Hello, Sinix, you wrote: As to T4, neither from examples, nor from the documentation, I and could not understand - as it can be used in situations distinct from "to me 180 methods Sum, for (U) Int8/16/32/64 and their combinations" are necessary. I want to declare only a method in the interface and to receive a heap of the ready code. S> and here it the ideal scenario for Roslyn analyser-a is direct. Or what extensions.  from a box . Here in search of similar decisions I also am. , unfortunately, extends only through system of plug-ins which are unrolled through NuGet-packages, and links on SDK yesterday were beaten.:D

27

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> I want to declare only a method in the interface and to receive a heap of the ready code. Also it was necessary to begin with it, the task is slightly more difficult, than stupid codegen. For  it is possible to look for keywords from here https://stackoverflow.com/questions/440 … a-member-v For  better at local forum JB .

28

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> And as I described, anything from this does not approach. So than that does not approach? Any strange at you there . LW> I too would take for basis LINQ. Alas. (And what with it not so that?

29

Re: in a Visual Studio 2013

Hello, VladD2, you wrote: VD> So than that does not approach? Any strange at you there . Well, here present that you develop kernel Linux, and suddenly speak - and give  MSSQL! Than does not approach? Well here, it is incompatible with life. I told that it is senseless to search for alternatives. There is one way to which can go now. Others while are closed.

30

Re: in a Visual Studio 2013

Hello, Sinix, you wrote: S> also it was necessary to begin With it, the task is slightly more difficult, than stupid codegen. For  it is possible to look for keywords from here S> https://stackoverflow.com/questions/440 … a-member-v About, thanks huge! Looks very much !

31

Re: in a Visual Studio 2013

32

Re: in a Visual Studio 2013

Hello, D.Lans, you wrote: LW>>> the People like something on Razor modeled from a hopelessness. DL> I from these people. I write on Razor templates for model generation + the controler + packs CRUD-vjushek for ASP.NET site under the information from a file typed by hands XML. I was familiar with a command which approximately and did. Only it was long before Razor, the generator on XML is simple on C# has been written. And, by the way, they also generated units-tests. On responses - very inconvenient system. Time saving in comparison with on writing of this set by hands small, and, besides, single. And here support of all of it turns to a nightmare: , therefore if it is necessary to change all behavior in any part it is necessary or to correct the generator (that long and risky and very inconveniently at teamwork) or to take any manual steps after generation. So there permanently there were any bugs of that something not so was generated or someone forgot something to launch or correct. Unfortunately, they had an uncontrollable technical lead-enthusiast and not skilled , therefore the command and suffered while at the very least did not quit in  then the project covered. On hearings covered because of very big time of adding of new features (still,  the generator to check up all places where something was generated...) it is possible that they "did not know how to cook" generation. But the relation at me to it since then the guarded. Well, that is, itself I apply, but counting all consequences.

33

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> Well, here present that you develop kernel Linux, and suddenly speak - and give  MSSQL! Well, and what for irrelevant things that ? You on  write? Time so that that hinders you to use all its means? LW> than does not approach? Well here, it is incompatible with life. Than? Arguments that is any? Or " " ()? LW> I told that it is senseless to search for alternatives. There is one way to which can go now. Others while are closed. In my opinion any senseless subject. You were not defined with criteria and is not clear that want. The first corrected, if you want to find the answer to a question - define accurate criteria. You reject something? Write the list of arguments against it something. Then compare the received lists. The list of advantages too does not prevent.

34

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> In process of code writing. In an ideal, from a menu on Alt+Enter, unfortunately, the functional live-template does not suffice. ((What exactly does not suffice? Multifile? LW> I think in this direction, but devil take it, I do not like a method  plug-ins to R#, not to mention what surrounding adjustment is any sheer hell, and  they till now not  (or something changed?). And it is possible more in detail about a hell and  ? LW> Reboot of projects does not arrange. Plus it is necessary to add manually integration with CVS (at least at level automatic  files). If to use wildcard, and to generate files in  places it is possible to do without an overload.

35

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> There is a remote base of the data to which it is necessary to fulfill the parametrized requests, modifying them both on client side, and on server side. LW> All on bicycles. Indirect decisions, normal ORM, LINQ/IQuerable etc. do not approach because of problems with licensing, certification, internal policy or moral restrictions. Well and than here you will help, except change of a place of operation? Or to suffer, or in any way. Still it is possible to look at generation of models on t4 in linq2db. https://github.com/linq2db/t4models

36

Re: in a Visual Studio 2013

Hello, qxWork, you wrote: W> What exactly does not suffice? Multifile? Under the signature of a call of a nonexistent method, it is necessary to deduce types of arguments and to generate some types and methods, let even in the same file. As far as I understand, it can achieve, using extensions for , but them, besides, it is necessary to write. W> and it is possible more in detail about a hell and  ? Certainly. We open docks. We rejoice to simplicity of the decision. We transit under the link and we fall out in a precipitate as realization of comes that to us suggest to solve Einstein's riddle. Further this suspicion only gets stronger. But it is good, we adult experienced programmers, are able in manuals and to carry out step by step instructions. We enter: PM> Install-Package JetBrains. ReSharper. SDK-Version 2017.2.1 we Receive: Install-Package: Unable to find version ' 2017.2.1 ' of package ' JetBrains. ReSharper. SDK '. Here it is turn! All right, to whom does not happen. We climb on a site for  version SDK... 404 Not Found (it is at the moment corrected, I lucky) Tightening a packet locally, we try to install. Attempting to resolve dependency ' xunit.abstractions (= 2.0.1) '. The ' xunit.abstractions 2.0.1 ' package requires NuGet client version ' 2.12 ' or above, but the current NuGet version is ' 2.8.60610.756 '. Yes well  yours ! , it is guilty, we put fresh updates. We repeat operation. It was installed! Ur! Well, now that we write the first plug-in and we begin to live!. Stop. What for.nuspec? I simply want to push F5 and to see Hello world in a menu R#! Hyperlinks are not present. Search in the documentation, naturally, does not give results (it is search!) . Okej, we experienced programmers also are able to use Google. About my God, how many letters! And all about the old version... Attempt number two. . It seems, it that is necessary for me. But stop, and what I read before?   differ from plug-ins? And if it is different pieces, where the description.nuspec for ?! What happens?! And all this time in a head is twisted thought, what about five years ago there were templates of projects in which it is possible to thrust everything, including dependences on NuGet-packages so what devil it is necessary to do all it is hands?! Somehow so.

37

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> the User writes: LW> LW> IInterface nt = new MyType (); LW> nt. DoSomething (arg1, arg2, arg3); LW> LW> Pushes ,  a method with the necessary signature on the basis of the transferred arguments in IInterface, and its implementations in all known successors of the given interface. Alt+Enter creates a method in the interface. One more Alt+Enter on the created method creates implementations in all types. If it would be desirable to create nonblank implementation, it is possible to write it in a body of the interface and therefrom Alt+Enter th to multiply on types.

38

Re: in a Visual Studio 2013

Hello, VladD2, you wrote: VD> the First corrected, if you want to find the answer to a question - define accurate criteria. You reject something? Write the list of arguments against it something. Then compare the received lists. The list of advantages too does not prevent. Vlad, you try to answer a question "as it to make correctly" which I did not set. I perfectly know, how it to make humanly. I ask, "how to implement was specific here this piece". I can  everything over and under the described decision, but it is a unique possible variant. Arguments are not present and will not be, as all  break about ferro-concrete "but I want so". I hope that in the future I will manage to leave from this crappy decision, but now it is not possible. Unless "as a hobby", but it is necessary "for business".

39

Re: in a Visual Studio 2013

Hello, qxWork, you wrote: W> If it would be desirable to create nonblank implementation, it is possible to write it in a body of the interface and therefrom Alt+Enter th to multiply on types. I thought of the similar approach, there is enough with small losses even it will be possible to remove all dependences and to make the uniform interface of access, but, unfortunately, it in any way does not relieve of necessity to create a class describing arguments of the caused method and returned result. All necessary can be deduced from the method signature and the transferred arguments, but at first it is necessary ,  to intercept them the output agent of that ALt+Enter'.

40

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> I thought of the similar approach, there is enough with small losses even it will be possible to remove all dependences and to make the uniform interface of access, but, unfortunately, it in any way does not relieve of necessity to create a class describing arguments of the caused method and returned result. All necessary can be deduced from the method signature and the transferred arguments, but at first it is necessary ,  to intercept them the output agent of that ALt+Enter'. I ceased to understand Something. The previous piece of the code with a method call and its arguments whence undertook?

41

Re: in a Visual Studio 2013

Hello, qxWork, you wrote: W> I ceased to understand Something. The previous piece of the code with a method call and its arguments whence undertook? The lazy programmer writes: String hello = "Hello"; String world = "world"; Int32 count = 1; String result = client. Do (hello, world, count); Pushes Alt+Enter, receives: [Serializable] class DoSpec {[Serializable] String Hello {get;} [Serializable] String World {get;} [Serializable] Int32 Count {get;} public DoSpec (String hello, String world, Int32 count) {Hello = hello; World = world; Count = count;}} partial interface IClient {String Do (String hello, String world, Int32 count);} partial class Client1: IClient {public String Do (String hello, String world, Int32 count) {SendSpec spec = new SendSpec (hello, world, count); var result = _connection. Invoke (spec); return result. GetString ();} } partial class Client2: IClient {public String Do (String hello, String world, Int32 count) {_pipe. WriteString (0, hello); _pipe. WriteString (1, world); _pipe. WriteInt32 (2, count); return _pipe. ReadString ();}}

42

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> Pushes Alt+Enter, receives: we write in T4 models. Add (new Method ("Do", {Hello=default (string), World=default (string), Count=1}); the Code in T4 receives on an input method name + anonymous type with the necessary properties.  from this methods in partial-types - minute business. UPD well here that for a masochism - to ask at all about what it is necessary to receive? http://www.gunsmoker.ru/2008/10/x-y-z.html in the pure state.

43

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> the Lazy programmer writes: there is refactoring Create class from method parameters for this purpose. Total 3 actions: - Alt+Enter create method from usage - create class from method parameters - Alt+Enter implement in derived classes

44

Re: in a Visual Studio 2013

Hello, qxWork, you wrote: W> Total 3 actions: W> - Alt+Enter create method from usage W> - create class from method parameters W> - Alt+Enter implement in derived classes Nea,  still is necessary a body of a method from parameters . Something of serialization type. The task either for emit, or for T4.

45

Re: in a Visual Studio 2013

Hello, Sinix, you wrote: S> we write in T4 S> S> models. Add (new Method ("Do", {Hello=default (string), World=default (string), Count=1}); S> S> the Code in T4 receives on an input method name + anonymous type with the necessary properties.  from this methods in partial-types - minute business. As you also wrote, it demands to separate to describe model. However, I still consider this variant. At least, it is more convenient in respect of long-term support.

46

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> As you also wrote, it demands to separate to describe model. However, I still consider this variant. At least, it is more convenient in respect of long-term support. Otherwise in the code there will be 100500 signatures which are not necessary any more.

47

Re: in a Visual Studio 2013

Hello, Sinix, you wrote: S> Nea,  still is necessary a body of a method from parameters . Something of serialization type. The task either for emit, or for T4. You are right, and an action implement serializable it is possible .

48

Re: in a Visual Studio 2013

Hello, qxWork, you wrote: W> Hello, Sinix, you wrote: S>> Nea,  still is necessary a body of a method from parameters . Something of serialization type. The task either for emit, or for T4. W> You are right, and an action implement serializable it is possible . A dirty trick still that the code , at  is some protocols (if it generally serialization). At least something similar on protobuf/asn and generally is not clear that (the library with api in style SendSpec () did not come across).

49

Re: in a Visual Studio 2013

Hello, Sinix, you wrote: S> the Dirty trick still that the code , at  is some protocols (if it generally serialization). At least something similar on protobuf/asn and generally is not clear that (the library with api in style SendSpec () did not come across). Generally in its example primitive - it all , it will be necessary only Serializable to hang out a class. But the mechanism on the general case to make difficult.

50

Re: in a Visual Studio 2013

Hello, LWhisper, you wrote: LW> T4 not to offer. LW> it is necessary to read a current line, to add in the project a file with new type and to modify 6 existing. LW> It would be desirable to have complete control over text formation. In the solved the similar task for large system and came to the following sheaf which strongly simplified life: 1. We write the extension to studio 2. Inside we use runtime T4 3. We cause the generator there where it is necessary, analyzing the code Rozlinom 4. Creation of files, modification of the project and other is accessible through EnvDTE Advantages in comparison with design time 4: 1. All  is written in *.cs a file, as the normal code 2. It is possible to write the elementary tests which will deduce at least  the code on the screen 3. It is possible to go further and to write real tests which will compile the code and will try to fulfill it