Questions tagged as 'c#'

2
answers

Make comparison using String.Contains () disregarding casing

I need to check if a term exists inside a string (in SQL it is something like like '%termo%' ). The point is that I need to do this without considering the casing of the two strings . How can I do this? Is there something nat...
asked by 24.01.2017 / 16:27
1
answer

Access Object Property with a string

Student: public class Aluno{ public int Id { get; set; } public string Nome { get; set; } public string Sobrenome { get; set; } } Now I need to access the student's First and Last Name through a string, how can I do this?...
asked by 20.01.2017 / 17:39
1
answer

String Contains Empty returns true

Why does using Contains("") in a string non-empty return true? Example if ("MinhaString".Contains("")) { Console.WriteLine("String contém vazio"); }     
asked by 21.11.2017 / 17:30
1
answer

Error There are no comments for in the schema

I'm following a tutorial to access database via LINQ. In the video, I saw a function that returns me a list with the data of the database: public static List<LicitacaoOffline> Buscar() { DatabaseEstoqueOfflineDataContext oDB = new...
asked by 28.12.2016 / 18:56
1
answer

Many-To-Many Relationship Mapping - EF Core - C #

I've tried to map a relationship between 3 classes, but I'm catching up. I have a Person class that represents any Person, an Employee, a Client, a Supplier, any kind of Person, be it physical or legal ... When I register a certain type of perso...
asked by 29.05.2017 / 23:52
3
answers

Group by interval of days using Linq

How can I use interval grouping with Linq? var dados = new[] { new { Id = 0, dias=100, preco= 25, Nome="etc"}, new { Id = 1, dias=40, preco= 50, Nome="etc1"}, new { Id = 2, dias=50, preco= 55, Nome="etc2"}, new { Id = 3, d...
asked by 08.06.2017 / 21:57
1
answer

Regular Expression, taking numbers between two pre-defined texts

I need to remove números from a string . The string follows a pattern: http://www.meudominio.com/1789519-texto The number will always be between / and - I have been able to arrive at the following formul...
asked by 03.09.2015 / 19:08
1
answer

Query with Many-to-Many Relationship Entity Framework

I'm new to Entity Framework and Linq, so my question may be very simple, but it's breaking my head. I have two entities: public class Fornecedor { public int FornecedorId { get; set; } public string Nome { get; set; }...
asked by 23.12.2015 / 03:06
1
answer

Deserialize Json list

For when return is only 1 record I use the following: { "id": "27", "name": "Daft Punk", "link": "https://www.deezer.com/artist/27", "share": "http://www.deezer.com/artist/27?utm_source=deezer&utm_content=artist-27&utm_term=767...
asked by 12.01.2016 / 11:56
2
answers

Capture text between two known characters

I need to get some text and find the words (or phrases) that are between two specific characters { and } , in this case. > I can do this by capturing the delimiters together, using the expression {(.*?)} , but I need th...
asked by 13.01.2016 / 17:57