New answers tagged asp.net
6
Stop!
You have a bigger problem than the readability. It looks like you don't understand how object initializers work.
Let's create a disposable class which traces its execution:
public class Demo : IDisposable
{
private string hello;
public Demo()
{
Debug.WriteLine("The parameterless constructor was called.");
}
public ...
2
It sounds like what you want is to be able to do is demo changes without having to make them to the "original" project. Most people use source control with branching to accomplish this.
1
The first snippet you posted isn't less readable because it uses initialization - it's less readable because it's poorly written. Each initialization assignment should have its own line (unless there's only one assignment, or the initialization block is very short.)
As for performance, I would be very surprised if the first snippet compiled differently than ...
3
If you both are going to work on a shared codebase, the only sensible way is to use a language you both master.
The best option, by far, is to learn each others' language. Not only will this give you two shared languages to work with (which means you can choose the most appropriate one for the job at hand), learning new languages is essential to becoming a ...
3
The short answer is no, there isn't.
You (or he) could produce a web API that the other could use for website / mobile apps or there are frameworks like Phalanger that you can compile assemblies in PHP to use with with other .Net languages (C#, VB.Net, F# etc). Note: I've not used Phalanger (so please don't take it as a recommendation) and it doesn't ...
7
You should learn ASP.NET/C#. The fact that you say you're a "PHP developer" hints that it's your only language; learning C# will be both a great learning experience and a good career move. If possible, pair with your friend using one monitor and two keyboards. Take turns typing code and asking questions. Jon Skeet's book, C# in Depth, is excellent. If it ...
0
This may be a case for further abstraction of your libraries/projects.
You say:
I want to add this test/tests to my existing test project. This way i
will have access to ALL Dtos and Contracts (and objects in general)
which are used in my application.
You should have no trouble getting access to your DTOs and contracts from a console application. ...
2
In a comment, you said:
What i am tryin to get out of this post is WHY not to do it.
Unit tests are meant to run to check that code works as intended. Because of this, they are often (I wish I could say "always") used with continuous integration, and automatically run whenever a new commit was made to the code. This can be several times in an hour, ...
2
I think you're looking at this the wrong way. What is the purpose of a unit test? To test that some piece of code works correctly. If that's not what you want to do, then don't use a unit test.
What you should do is to create a separate console application that references your other projects. This way, you can use all the code you already have. A good place ...
13
A test is a test, and what you described is an application, not a test.
Don't write code that you don't want run again and again and again as a unit test. Write a console app, or a winforms app, or an add-in or whatever, but NOT as a test.
Feel free to write a unit test for your code, though. What you think is a one-off code will often wind up sticking ...
4
hang on - you want to write a unit test that actually performs the work you want doing??
It does seem to me that you've violating the principle of keeping it simple, by trying to fudge unit test framework to do something it wasn't intended.
Make a console app, it'll be easier to deploy to an environment that might not have your version of the dev tools ...
2
Is it a unit test?
some one-off code in c#.net that will do some db manipulation
Ok. Database manipulation doesn't mean database access. You may have used a mock of the database in order to concentrate on the manipulation itself.
of existing records
So the code should work for only a predefined set of data? If you're not creating data processing ...
-2
So, you want to write some functional tests?
If you use unit tests framework, it will be simpler to add new tests, and you'll have functions (or macros) to do some tests. Of course, do not mix functional and unit tests, since unit tests have to be fast. Also, do not use mock classes, because you want to do black box testing.
Good thing about functional ...
0
If anyone is curious, in the end we ended up going with the scheduler from DayPilot (http://www.daypilot.org/) and using Ext.NET for the rest of the UI (http://www.ext.net/).
2
Can you be more specific than just ASP?
Standard MVC ASP has all the models and controllers compiled, so the client just gets binaries and views. While it's much easier to reverse engineer than say C, it's still often more hassle than just paying the developer. And then you can program in whatever time limitation you want.
I've also always had luck by ...
4
Since your source needs to be on the web server and the server needs to read it, it's pretty difficult to protect your code unless you alone control the server.
The client will want to see the product working but that doesn't necessarily have to be on their server/network. If you can mock up the client's environment (required databases, etc.) you can stand ...
0
Is the intranet closed to the outside world? Otherwise you could you extract some components from the architecture and provide them as a service on an external server that you control, given that the architecture itself allows it.
8
Unless you install your ASP.NET application on hardware that you alone have admin on, no. An unscrupulous client can take without paying, and pay some unscrupulous programmer to work around any trap you leave.
Include clauses in your contact allowing you to collect both interest and collection expenses if they fail to pay on time, and requiring that they ...
0
There are a number of scenarios where your deployment could be different per environment:
Which machines are being deployed to (obviously).
Config files (you mentioned this).
Number of machines (or VMs) per environment.
Load balancer.
Network configurations.
Authentication.
There could be lots of others, but it's hard to say without more info on your ...
1
NTLM is probably one of the better options you've got in terms of authenticating in the clear, but you still have plenty of vulnerability if you aren't encrypting the transport layer, even in a somewhat trusted environment. Basically, if the data matters spend the extra $25 and get yourself a legit certificate.
2
Take a look at using a generic base repository that contains some of the common functionality between all repositories.
interface IRepository<T>
{
void Save();
T GetById(int id);
int GetCount();
}
From this you can create custom repositories for each action.
interface IUserRepository : IRepository<UserPosts>
{
UserPosts ...
Top 50 recent answers are included

