Posts by JamesTK • 901 points
35 posts
-
-1
votes1
answer873
viewsQ: PDF generated with iTextSharp adding image gets bad quality
I have an image file that I need to pass to PDF and for this I am using the iTextSharp. So I’m trying this way: private static void Main(string[] args) { using (var stream = new…
-
1
votes0
answers32
viewsQ: Depencyresolver problem when using Testserver, difference between instantiating Httpconfiguration and not instantiating
I have a simple authorization filter that to get an instance of a service I require in GlobalConfiguration.Configuration.DependencyResolver. Thus: var service = GlobalConfiguration.Configuration…
-
0
votes1
answer208
viewsQ: Error 404 when loading resources from node_modules folder with Angular2
I am with an application using angular 4 that is giving error 404 when trying to load resources css, fonts and javascript folder node_modules. It’s like this on my index.html: <link…
-
1
votes1
answer418
viewsQ: How do I go through the Firefox Insecure Connection alert page with Geckodriver?
How to pass certificate error screen (insecure connection) with Geckodriver Firefox Webdriver? I’m hitting a URL that displays this alert. I already added in the browser exceptions, but the problem…
-
2
votes0
answers186
viewsQ: How to configure Owincontext Authentication in Simpleinjector 3.3.2?
In my current application I use Simpleinjector 3.2.0 with a similar configuration to this: var container = new Container(); container.Options.DefaultScopedLifestyle = new WebRequestLifestyle();…
-
1
votes1
answer110
viewsQ: Code line in Unit Test that is not accepted by code coverage
I have a test routine where a certain line of code is not accepted by the coverage. This is a test to return Defaultvalue since the object calling it is null. This is the method being tested public…
-
5
votes2
answers3911
viewsQ: How to create local domains to test my websites and apps?
For my tests I would like to create a redirect from any domain to localhost:porta on a local computer, in Windows. I thought it would be possible by the hosts file on…
-
1
votes1
answer86
viewsQ: How to set up an Authentication and Authorization Server?
How to set up an authentication and authorization server like Google, by Cookie, and then be able to make available to ASP.NET MVC applications of the same group of web applications with the same…
-
2
votes1
answer380
viewsQ: Routine included in Threadpool to run in "background" does not let the application continue running
I have the following code snippet in a method from my ASP.NET MVC application that deals with deleting directories and their files. // efetuo processos de remoção de arquivos do banco de dados await…
-
6
votes1
answer483
viewsQ: Migration, Delphi and Firebird. What is the correct way to deal with the Encounter issue?
I have a project in Delphi 7 that makes use of Firebird. I think about migrating this application to a Delphi XE version*. However, we know that from Delphi 2009 the String standard is Unicode and…
-
1
votes1
answer509
viewsQ: How to change web.config when running Deploy?
I have an approval and production environment in the cloud but I do Deploy in File System. I have to enter some parameters and change the connectionString for each of these environments. Examples of…
-
0
votes0
answers97
viewsQ: Records in Icollection<> navigation property are not being recorded
I’m trying to make an inclusion of items in a list property but I’m not able to include the records in the database. First I have the following class models: public class Frota { public Frota() {…
-
1
votes3
answers155
viewsA: How to test Filters that verify Claims data?
How I resolved: protected static ActionExecutedContext FakeExecutedContext(IPrincipal principal = null, Controller controller = null) { var request = new Mock<HttpRequestBase>();…
-
6
votes3
answers155
viewsQ: How to test Filters that verify Claims data?
I own a ActionFilter for some controllers and actions that make use of the user information that are in Claims. The filter itself obtains information from Claims user and executes the authorization…
-
1
votes1
answer4061
viewsA: Webservice Delphi Soap with authentication
My example of adding a header to the object HTTPRIO for authentication: class function TCRMWebServices.GetFileTransferService(AUsername, APassword: string; ASendEvent: TPostingDataEvent):…
-
5
votes1
answer1942
viewsQ: Error when running test project
I added a test project to my Solution to test the methods of my MVC application. I created a base class, for the other classes with tests to inherit from it, which contains context creation…
-
2
votes1
answer282
viewsQ: 404 ASP.NET MVC fails when attached file is large
I’m using the plugin jquery.filer to send files to attach files in my form. I chose this because it was a plugin that managed to manipulate it to send the data of the other inputs along with the…
-
2
votes1
answer97
viewsQ: How do I not lose the data included in Claims in the revalidations of Cookies?
I have an application that needs to control the access of users who are according to the profile of each one. Empresa, Filial. In the User entity I added the fields referring to these other two…
-
1
votes2
answers673
viewsQ: How to return to the previous page by Handleerrorattribute?
I am trying to implement a global filter for error handling and started testing as follows: public class MyHandleErrorAttribute : HandleErrorAttribute { public override void…
-
3
votes1
answer390
viewsQ: Enter additional data, from the bank, into the user’s Claims. What is the best time or the right way to do it?
I have some extra information that I need to add to the user’s Claims that are from other tables and classes. Considering the method generated by the ASP.NET MVC template with Identity in the class…
-
1
votes2
answers254
viewsA: Scaffold MVC Template Editing. How to get project reference in Solution Folder?
Solution found in: Envdte : Getting all Projects (the Solutionfolder PITA) Well, I created an additional file where I put my functions, called Morefunctions.cs.include.T4 and added in the template…
-
3
votes2
answers254
viewsQ: Scaffold MVC Template Editing. How to get project reference in Solution Folder?
I am editing the T4 templates from ASP.NET MVC’s Scaffold and I need to get some extra class information. At first, for example, of the attribute DisplayName class. I found some examples: var env =…
-
3
votes1
answer357
viewsQ: Fluent Nxn mapping of Classes with composite key
I have two classes that have composite primary keys, example: Cliente: public class Cliente { public int EscritorioId { get; set; } public virtual Escritorio Escritorio { get; set; } public int Id {…
-
1
votes1
answer91
viewsQ: How to perform the Submit of a form with Onsenui and Angularjs?
How to proceed to perform a Submit with Onsen UI + Angularjs? I got the following ons-page: <ons-page ng-controller="LoginController"> <ons-toolbar> <div class="center">Acesso ao…
-
1
votes2
answers1498
viewsA: Entityframework, Migrations and Mysql. Schema name being misinterpreted. How to resolve?
Summarizing and synthesizing my problem, the confusions in you that I committed and what was done. The Entityframework Power Tools, from what I understand, do not distinguish database when…
-
3
votes2
answers1498
viewsQ: Entityframework, Migrations and Mysql. Schema name being misinterpreted. How to resolve?
I have a problem using Migrations with Mysql. When I try to create the first version with Migrations he’s making the schema/name of the bank part of the table name: public partial class Initial :…
-
6
votes1
answer781
viewsQ: Connection pool with ADO.NET and Sqlconnection Dispose, what is correct to do?
I asked a question yesterday about What is the difference between Idisposable implementations? I was implementing a class to help obtain instances of SqlConnection, SqlCommand, SqlDataReader methods…
-
8
votes2
answers1716
viewsQ: What is the difference between Idisposable implementations?
I confess that I still don’t understand everything about how to manipulate the destruction of an object in the C# and now, as I’m testing Visual Studio 2015 Preview, when implementing a database…
-
4
votes1
answer175
viewsQ: What is the difference between the declaration forms of Generics with out and in?
What is the difference between Generics statements when using out and in? Example: public class GenericClass<T> { } public class GenericClassOut<out T> { } public class…
-
8
votes3
answers117
viewsQ: Architectural problem where access to construction methods should be controlled
I have a class for tree that will have the addition of trunks, branches, leaves and fruits. I need the class to give access to certain methods only after others and that the previous ones cannot be…
-
2
votes0
answers41
viewsQ: Reference count plugin for VS 2013 Community
Is there a plugin to count references on Visual Studio 2013 Community as that of the Codelens? I didn’t know that in this version Codelens is not part of that version.…
-
3
votes3
answers3422
viewsA: Difference between Getter Setter and Property in Delphi
Based only on experience I say that using methods, one method to obtain the value and another to set the value, is an unnecessary code wear unless you have rules (validations/checks) to be made on…
-
6
votes1
answer1099
viewsQ: What are the advantages of using namespaces in Delphi?
From the 2009 version of Delphi (if I’m not mistaken) came the namespaces. I would like to know, in a simple example if possible that illustrates a case of advantage, what would be the advantages of…
-
2
votes1
answer481
viewsA: Ajax.Beginform returning Partialview as View
Okay, according to your comment that clarified my doubt, you need to add also the jquery.unobtrusive-ajax. Just look for Microsoft.jQuery.Unobstusive.Ajax for Nuget or in the Package Manager Console…
-
2
votes2
answers1346
viewsA: How to login to WEB project Asp. Net MVC No Authentication?
If you’re going to use ASP.NET Identity, which is great, check out this post where the rewarded user shows you how to include ASP.NET Identity from a template WITHOUT o ASP.NET Identity - No…