Skip to content

Instantly share code, notes, and snippets.

View NMZivkovic's full-sized avatar

Nikola Živković NMZivkovic

View GitHub Profile
public class ReportActor : ReceiveActor
{
private Dictionary<string, long> _articleTimeSpent;
private Dictionary<string, int> _articleViews;
public ReportActor()
{
_articleTimeSpent = new Dictionary<string, long>();
_articleViews = new Dictionary<string, int>();
var person = new Tuple<string, string, int>(
"Nikola", "Rubiks Code", 30);
Console.WriteLine("{0} has a blog called {1}, and he is {2} years old",
person.Item1, person.Item2, person.Item3);
private (string, string, int) GetNameBlogAndAge()
{
return ('Nikola Zivkovic', 'www.rubikscode.net', 30);
}
var nameBlogAge = GetNameBlogAndAge();
Console.WriteLine("Name is: {0}", nameBlogAge.Item1);
private static (string name, string blog, int age) GetNameBlogAndAge()
{
return ('Nikola Zivkovic', 'www.rubikscode.net', 30);
}
@NMZivkovic
NMZivkovic / Tuple3.cs
Last active September 28, 2017 10:57
private static (string, string, int) GetNameBlogAndAge()
{
return (name: 'Nikola', blog: 'www.rubikscode.net', age: 30);
}
var nameBlogAge = GetNameBlogAndAge();
Console.WriteLine("Name is: {0}", nameBlogAge.name);
(string name, string blog, int age) = GetNameBlogAndAge();
Console.WriteLine("Name is: {0}", name);
using (var sqlConnection = new SqlConnection(connectionString))
{
sqlConnection.Open();
try
{
using (var readCommand = new SqlCommand("select * from Entity", sqlConnection))
{
var reader = readCommand.ExecuteReader();
using (var sqlDataHandler = new SqlDataHandler())
{
var entity = sqlDataHandler.ReadEntity();
sqlDataHandler.UpdateDataFieldInEntity(entity, modificationValue);
}
Console.WriteLine("Data successfuly modified!");
Console.ReadLine();