Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for Alexei
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #279277 |
Post edited: added relevant tags |
— | over 4 years ago |
Edit | Post #279317 | Initial revision | — | over 4 years ago |
Answer | — |
A: How to automatically run Entity Framework Core migrations for an application which uses a user with read/write rights on certain tables? Migrations are applied during the application startup (initialization) only when the application is not accessible yet. One way to go is to leave the existing user as it is and define a designated one for the migrations. Applying the migrations requires powerful roles (create or drop table): - ... (more) |
— | over 4 years ago |
Edit | Post #279316 | Initial revision | — | over 4 years ago |
Question | — |
How to automatically run Entity Framework Core migrations for an application which uses a user with read/write rights on certain tables? I have decided to convert a legacy database-first ASP.NET Core project to code-first. However, I have noticed that the project used the same database as another bigger project and the Entity Framework user had the minimal rights (read and write on some tables). Clearly, this does not allow the app... (more) |
— | over 4 years ago |
Edit | Post #279187 |
Post edited: fixed a typo |
— | over 4 years ago |
Edit | Post #279187 |
Post edited: fixed variable name |
— | over 4 years ago |
Edit | Post #279187 |
Post edited: fixed the link |
— | over 4 years ago |
Edit | Post #279187 | Initial revision | — | over 4 years ago |
Answer | — |
A: Is there a way to automatically fix MySQL tables where the auto_increment has fallen behind the correct value? This is possible in two steps by using a dynamic SQL: SET @nextId = (SELECT MAX(id) + 1 FROM `CustomTable` ); SET @sql = CONCAT('ALTER TABLE `CustomTable` AUTOINCREMENT = ', @nextId[]()); PREPARE st FROM @sql; EXECUTE st; However, if the values fall frequently you should try ... (more) |
— | over 4 years ago |
Edit | Post #279144 |
Post edited: added relevant tag |
— | over 4 years ago |
Edit | Post #279097 |
Post edited: added tag |
— | over 4 years ago |
Edit | Post #279146 | Initial revision | — | over 4 years ago |
Answer | — |
A: In MySQL is there a limit to the number of keys in a IN() clause? According to the documentation for the MySQL IN function: > The number of values in the IN() list is only limited by the maxallowedpacket value. The default value for it is 67108864. So, you should be able to squeeze quite a big number of identifiers, but you should definitely try it out to... (more) |
— | over 4 years ago |
Edit | Post #279059 |
Post edited: added MoreLINQ reference |
— | over 4 years ago |
Comment | Post #278952 |
I have reported the issue on GitHub (thanks Monica for moving it to the right place, now I know that qpixel is the actual project :) ): https://github.com/codidact/qpixel/issues/268 (more) |
— | over 4 years ago |
Edit | Post #279059 | Initial revision | — | over 4 years ago |
Answer | — |
A: How to perform LEFT JOIN using LINQ method call notation? Note: this was tested in a .NET Framework 4.6.2 project. This answer provides an extension method that greatly simplifies (and makes it more intuitive) the written code: public static IQueryable LeftJoin( this IQueryable outer, IQueryable inner, Expression> outerK... (more) |
— | over 4 years ago |
Edit | Post #279058 |
Post edited: simplified the query |
— | over 4 years ago |
Edit | Post #279058 | Initial revision | — | over 4 years ago |
Question | — |
How to perform LEFT JOIN using LINQ method call notation? I am interested in performing a LEFT JOIN using LINQ-2-SQL when working with method call notation. This answer suggests a way that relies on GroupJoin but it is more verbose than expected: var leftJoin = p.Person .GroupJoin(p.PersonInfo, n => n.PersonId, m => m.PersonId, ... (more) |
— | over 4 years ago |
Edit | Post #279034 |
Post edited: added relevant tag |
— | over 4 years ago |
Edit | Post #279051 | Initial revision | — | over 4 years ago |
Answer | — |
A: Is it possible in MySQL to require each row in a table have at least one foreign key record in a join table? `ghost-in-the-zsh` provided a direct answer and I will try to offer a more general complementary one. One possible thing to try is a trigger that checks the integrity, but it cannot work for inserts because the order must be something along the lines: START TRANSACTION INSERT INTO B ... (more) |
— | over 4 years ago |
Edit | Post #278992 |
Post edited: added relevant tag |
— | over 4 years ago |
Edit | Post #279035 |
Post edited: Removed irrelevant information |
— | over 4 years ago |
Comment | Post #279035 |
@Charlie Brumbaugh Yes, that means that the index contains that column + columns in the PK. That would explain the second point which actually seems to be the only point: all indexes will only cover the column in the PK. (more) |
— | over 4 years ago |
Edit | Post #279035 | Initial revision | — | over 4 years ago |
Answer | — |
A: Why would an unique index get moved to the primary key after the underlying column is dropped? I can't say that I fully understood what you did, but I think I got the explanation: - removed 1+ columns that were part of the index. The index will be updated to not include that column. > If columns are dropped from a table, the columns are also removed from any index of which they are apar... (more) |
— | over 4 years ago |
Comment | Post #279002 |
@FractionalRadix Yes, [binding] is very general, but it is what I heard being used for frameworks such a Windows Forms. WPF, Angular and Xamarin. Maybe something like [android-viewbinding] is more appropriate, but I am not sure if this is what you are using (never programmed directly with Java in And... (more) |
— | over 4 years ago |
Comment | Post #279002 |
I have also added [binding] tag as the concept seems to be used (bind view to viewmodel). Very good question btw. (more) |
— | over 4 years ago |
Edit | Post #279002 |
Post edited: added relevant tag |
— | over 4 years ago |
Edit | Post #278695 |
Post edited: removed useless tag |
— | over 4 years ago |
Edit | Post #279014 | Initial revision | — | over 4 years ago |
Question | — |
Do we really need the [tools] tag? During my review of the posts and tags, I have seen the tools tags. It is very generic and I am sure if it is helpful. What do you think? (more) |
— | over 4 years ago |
Edit | Post #279008 | Initial revision | — | over 4 years ago |
Answer | — |
A: How can I add "withCredentials:true" for HTTP requests generated by Swagger UI? One way to solve this without customizing the Swagger UI is to deal with it on the server side. The following assumes that the swagger docs is served at `/swagger` relative path. Middleware /// /// Middleware to protect API Swagger docs /// public class SwaggerAuthorization... (more) |
— | over 4 years ago |
Edit | Post #279007 | Initial revision | — | over 4 years ago |
Question | — |
How can I add "withCredentials:true" for HTTP requests generated by Swagger UI? I have added Swagger UI for an ASP.NET Core 3.1 application and I have realized that all endpoints requiring Windows Authentication fail. This issue is created by the fact that generated HTTP requests do not include withCredentials (what I used in the Angular client consuming the same API). This S... (more) |
— | over 4 years ago |
Edit | Post #279006 | Initial revision | — | over 4 years ago |
Answer | — |
A: Is omitting braces for single statements bad practice? Already good answers, but I can provide a slightly different perspective here: always use braces if there is a risk of getting into a pitfall. Examples (from C#, but the language is less relevant). - omit if the inner instruction fits on a single line and an extra blank line is inserted after:... (more) |
— | over 4 years ago |
Edit | Post #278771 |
Post edited: added relevant tags |
— | over 4 years ago |
Edit | Post #278547 |
Post edited: added relevant tag |
— | over 4 years ago |
Comment | Post #278988 |
@Moshi That would be great and intuitive for anyone using such a feature. (more) |
— | over 4 years ago |
Edit | Post #278988 | Initial revision | — | over 4 years ago |
Answer | — |
A: What is the point of tagging a question with both a parent and a child tag? I can provide an answer based on Stack Overflow experience. SO offered watches by tags. By using a general tag along with a more specific tag, users interested in [sql] will also get the question in their feed. While I could find this feature on Codidact, it makes sense to implement it in the futu... (more) |
— | over 4 years ago |
Comment | Post #278982 |
Not sure, but shrink gets the database to 4GB and reindexing gets it to about ~5GB. (more) |
— | over 4 years ago |
Edit | Post #278983 |
Post edited: removed meta related tags |
— | over 4 years ago |
Edit | Post #278982 | Initial revision | — | over 4 years ago |
Answer | — |
A: How can I can I reduce the size of a SQL Server database after being restored and massive embedded files stripped? One way to solve this is to shrink the database and reindex all tables to fix the indexes fragmentation: DBCC SHRINKDATABASE (TheDatabase); GO -- reindexing all tables to optimize performance after the DB shrink declare @TableSchema varchar(255) DECLARE @TableName varchar(255) D... (more) |
— | over 4 years ago |