Questions tagged as 'c#'

1
answer

How to print the entire string if the length exceeds the page

I have to print a string that can vary in size. What I need is if this string does not fit on the page the remaining text is printed on another. I know for this I need to do something using e.HasMorePages but I do not know how. I've b...
asked by 12.11.2014 / 19:43
1
answer

How to force login after running the application?

My scenario is as follows: After authentication with Active Directory, the logged-in user is saved in a Session [HttpPost] public ActionResult Login(LoginModel model, string returnUrl) { if (!this.ModelState.IsValid) return View...
asked by 21.10.2014 / 21:14
2
answers

Is it feasible to use more than one DbContext for the same database?

I'm developing a new application in ASP.NET MVC and searching I've seen some examples of applications with more than one context. Let's say my application has several different modules, but all entities have some connection. In this...
asked by 09.03.2015 / 21:07
1
answer

Unit test of implementations of a generic class

Suppose we have the following Interface: public interface ICRUDService<T> { T Create(T entity); } Abstract Implementation: public abstract class CrudService<T> : ICRUDService<T> { IRe...
asked by 06.03.2015 / 00:10
2
answers

Changing System Culture

Developing a system for a Bolivian company, on a windows with culture pt-BR , some objects like datetimepicker have their internal components according to the language in which the system was installed. Home And in my case, when thi...
asked by 23.09.2014 / 16:10
1
answer

Code First Table Migration - N for N using Fluent API

I have the following classes: [Table("Area_Cursos_Turma")] public class Turma { public int TurmaID { get; set; } public virtual ICollection<Aluno> Alunos { get; set; } } [Table("Area_Cursos_Aluno")] public class Aluno { publ...
asked by 26.09.2014 / 14:06
3
answers

Multi Banks / Cache / Client Layer

We are looking at ways to develop functionality for a system, which will be in C # .Net. I would like to hear opinions on how we can do this, if we can use some frameworks or something else. Access to multiple banks We need the syste...
asked by 21.09.2014 / 01:43
2
answers

Cipher of vigenere

private static void algoritmo(String input, String chave, Boolean b) { Console.WriteLine("Digite a mensagem: "); input = Console.ReadLine(); Console.WriteLine("Digite a chave: "); chave = Console.ReadLine();...
asked by 19.02.2017 / 01:35
1
answer

How to group items in a list with a condition?

I have a list with a property called tamanho which can contain two values: "M" or "I". I need this list to be random, but with a grouping condition. "M" would be half page and "I" would be whole. That is, I need to always have 1 int...
asked by 28.07.2015 / 19:20
2
answers

Protect Class for C # namespace

I'm developing a C # application for Unity 3D where it will manage various database types (Mysql, Postgress ...), the problem is that I have classes that manipulate each type of database within my namespace, which are used by several other classe...
asked by 30.05.2016 / 23:15