This is a personal reminder that default IdentityUser and its friends (like IdentityRole) generate the ID value in its constructor. These classes extend the behavior of the generic classes (IdentityUser implements IdentityUser<TKey, …> with IdentityUser<string, …>). If you happen to use your own class that inherits from them, you’ll be responsible for generating that ID. Otherwise, you’ll get an error like the following: System.Data.SqlClient.SqlException: Cannot insert the value NULL into column ‘Id’ table ‘dbo.AspNetUsers’; column does not allow nulls. INSERT fails. The statement has been terminated. IdentityUser implementation IdentityUser: Microsoft Docs | Code at Github (aspnet/Identity) IdentityUser<TKey, TLogin, TRole, TClaim> : Microsoft Docs | Code at Github (aspnet/Identity) IdentityRole implementation IdentityRole:… Read More
Continue ReadingDomain events in C#
An event is something that has happened in the past. A domain event is, something that happened in the domain that you want other parts of the same domain (in-process) to be aware of. The notified parts usually react somehow to the events. Domain events: design and implementation Benefits Since domain events are… well, events, it comes with all the benefits and use cases that you would have if you implement some sort of event driven architecture: Reduce coupling between the effect and the consequence: creating a user and notifying that a user was created have different levels of complexity, different responsibilities, different reasons to change… You won’t have a… Read More
Continue ReadingHow to react to while being critized in a talk
I was on Twitter the other day and stopped in a tweet of a developer (@adelatorrefoss) who had given a talk and had had a bad experience. [post] Hoy os cuento mi experiencia, un tanto dura, en la sesión que propuse en el Open Space del WeCode Fest de hace un par de semanas. Es bastante personal, pero creo que puede ayudar a observar mejor lo que significa un open. https://t.co/wK4qmz6JQp — Toño de la Torre (@adelatorrefoss) March 19, 2018 The talk was about how to face a legacy code that was newly given. The talk was going fine until some attendants started to disagree with the choices made by… Read More
Continue ReadingProblems with ADB via WIFI
If you develop Android apps, you might get into problems when trying to debug through WIFI and get that dreadful message. unable to connect to 192.168.1.xxx:5555: cannot connect to 192.168.1.xxx:5555 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060) Network stuff is tricky because it’s difficult to debug and once you’ve resolved the problem thanks to any web post, you forget again until the next time. That’s why, I’m going to list here common causes and possible solutions. You will have found some of them in other sites because they are… Read More
Continue ReadingThink twice
As developers, we are doers, we are the kind of people that like to act instead of wasting time. This is good, this is really good, I’ve met a lot of people that liked to talk and do nothing. But I’ve also met people that failed because I did not think twice. And when I say that I’ve met people like that is because I am one of them. I cannot finish counting the times that something went wrong just because I didn’t plan it in advance. The great point about thinking is that it is cheap. I’m going to list the different steps that are behind implementing something: Think… Read More
Continue ReadingDo not overwork
What would happen if days had 30 hours instead of 24? Would we meet deadlines more easily? Would we have the same problems we have now? My guess is that we would add those extra hours to our estimates without changing anything, which would mean that we would keep failing. That’s the reason behind this post’s title. I don’t consider myself a lazy worker (well, who does?). In fact, I struggle to obey this post’s title. You will surely have experienced that moment when your day has ended but you want to finish that feature you’ve been working on for hours or even days. Won’t you also have experienced that… Read More
Continue ReadingThe brand new black box in the shop
Before starting turning things upside down, I owe you an apology: in this article I’m not going to talk about architecture with a big picture, I will do it with a simple one. Do not take this as an architecture article. Real-life background In human history (well, I would extend this to animal history), every time we all needed to do something, we tried to do it as a group. If we needed to do actions in the town, we as groups (not as individuals) decided what to do. If you are planning to build a house, you probably sign a contractor firm that will know what to do and… Read More
Continue ReadingAre ideas so important?
I often read people talking about someone else stealing their ideas. We’ve been taught that ideas are gold, but they never told us that they were gold for the world, not for any particular person. Each of us are so blind that we think that our idea is unique, none of the 7 billion people in the world (and only counting the alive ones) has ever had a similar idea… Well, I’m afraid to tell you that it is almost impossible. The harsh reality gives us about three options: The idea is good but there are no competitors: it means there is no profitable market. The idea is good and… Read More
Continue ReadingGit Cheatsheet
I needed this, I was like every hour searching in Google one of the following commands… and having this page cached looks more efficient. Commands git clone URL folder This clones a repo to a given folder. If you don’t write the folder, it will try to clone it in a folder whose name be the repo name. If there is already a folder with that name, the clone process will fail. git init It creates a git structure in the current folder git add file It stages the given file. If you put a dot instead, it stages everything. git commit -m “Your commit message” It creates a commit with… Read More
Continue ReadingDebug mobile app in both mobile and computer
While we are developing a mobile app that talks to an API on our own, we may want to just put a breakpoint in an API call and see what happens. Although the best way to test and API is with programs like Postman, there are occasions where we need some context about when a call is made and for what reason. This looks difficult considering the fact that we are developing the API in the computer’s localhost, which is different than mobile’s localhost. We usually have an intuition here because we think that, being in the same network, there should be a way to access the computer. If you… Read More
Continue Reading